GetTreeFirstLevelChildDocuments

<< Click to Display Table of Contents >>

Navigation:  Programming Mechworks PDM > DBWCommandShell > Commands Reference > Tree >

GetTreeFirstLevelChildDocuments

available from build: 20080912

Description

This command returns the displayed 1st level child document UNIQUE_IDs of the currently selected item in the current Tree control

Syntax

call DBWShell("GetTreeFirstLevelChildDocuments [UniqueID]")

Parameters

UniqueID

Optional. document's unique id; if not passed, the currently selected tree's item will be used.

Results

The %TMP%\dbwreslt.in contains the list of @DOCUMENT_UNIQUE_ID of the 1st level displayed child documents.

The format of the result file is:

@DOCUMENT_UNIQUE_ID=<parent uid>,<child uid>
@DOCUMENT_UNIQUE_ID=<parent uid>,<child uid>
@DOCUMENT_UNIQUE_ID=<parent uid>,<child uid>
...

Example

Sub main()

 DBWInit(TRUE)
 DBWShell("GetTreeFirstLevelChildDocuments")
 uidsString = ""
 Set fs = CreateObject("Scripting.FileSystemObject")
 Set tfolder = fs.GetSpecialFolder(TemporaryFolder)
 Set a = fs.OpenTextFile( tfolder & "\" & "dbwreslt.in", ForReading, True )
 Dim tokens
 Do While a.AtEndOfStream <> True
  line = a.ReadLine
  tokens = Split( line, "=", 2, 1)
  uidsString = uidsString + tokens(1) + vbcrlf
 Loop
 a.Close
 DBWMsgBox "First Level displayed unique IDs:" & vbcrlf & uidsString
end sub