|
<< Click to Display Table of Contents >> Navigation: Programming Mechworks PDM > DBWCommandShell > Commands Reference > Document > GetHiddenFilesList |
available from build: 20141014 |
The command returns the list of hidden files (revision files, master drawing files, etc.) that may exist for a particular document.
call DBWShell("GetHiddenFilesList uid ext")
Uid |
The unique id of the document to look for hidden files of |
|---|---|
ext |
The extension of the related hidden file to look for |
The %TMP%\dbwreslt.in contains the list of file with passed extension that are related to the referenced document.
For example, in case of document with file name like myDoc.SLDPRT that has been revisioned 3 times and with passed "TREE" extension, the result file will appear like followings:
R:\myDoc.SLDPRT.___.TREE
R:\myDoc.SLDPRT.1.TREE
R:\myDoc.SLDPRT.2.TREE
R:\myDoc.SLDPRT.3.TREE
...
this example show a list of possible extensions for hidden files related to a selected record and then display a message containing found files.
Sub main()
DBWInit(true)
call DBWShell( "CurrentDocument" )
if (okDBW = False) then
exit sub
end if
docUId = DBWResult( "@DOCUMENT_UNIQUE_ID" )
values = "GZ" & vbCRLF & "TREE" & vbCRLF & "PDF" & vbCRLF & "JPG"
title = "Select the type of hidden file to look for"
default_value = 1
ok = DBWList(values, title, default_value, HiddenFileType)
if HiddenFileType <> "" then
DBWShell("GetHiddenFilesList " & docUId & " " & HiddenFileType)
listOfFiles = ""
Set fs = CreateObject("Scripting.FileSystemObject")
Set tfolder = fs.GetSpecialFolder(TemporaryFolder)
Set a = fs.OpenTextFile( tfolder & "\" & "dbwreslt.in" , ForReading, True )
Do While a.AtEndOfStream <> True
line = a.ReadLine
if line <> "" Then
If listOfFiles <> "" then
listOfFiles = listOfFiles & vbcrlf
End if
listOfFiles = listOfFiles & line
end if
Loop
a.Close
if len(listOfFiles) > 0 then
DBWMsgBox listOfFiles
else
DBWMsgBox "no " & HiddenFileType & " file found"
end if
end if
End Sub