GetTreeParentProject

<< Click to Display Table of Contents >>

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

GetTreeParentProject

available from build: 20070424

Description

The command returns the Unique ID of the nearest Parent Project in the current Tree structure.

When used with no parameters, it returns the nearest Parent Project Unique ID of the currently selected item in the Tree. When invoked passing a Unique ID as parameter, it first tries to select a document in the current Tree with the Unique ID equal to the one passed as parameter, then returns the nearest Parent Project in the Tree structure.

Syntax

call DBWShell("GetTreeParentProject [uid]")

Parameter

uid

Optional.The document unique id

Results

@PROJECT_UNIQUE_ID

The unique id of the nearest Parent Project

Remarks

In this case the returned value is 1068 (project2-A).

GetTreeParentProject1

In this case the returned value is 576 (project2).

GetTreeParentProject2

Example

Sub main

      DBWInit(TRUE)
      DBWShell("GetTreeParentProject")
      if(okDBW=False) then exit sub
      projectUniqueId = DBWResult("@PROJECT_UNIQUE_ID")
      DBWMsgBox "The parent project unique id is " & projectUniqueId
end sub