DBWGetAssemblyList

<< Click to Display Table of Contents >>

Navigation:  Programming Mechworks PDM > DBWCommandShell > Library Reference > Document >

DBWGetAssemblyList

Description

Returns a list of assemblies in which the specified document is used.

Syntax

Function DBWGetAssemblyList(DocUid, byref LastAssemblyUidbyref NumOfAsmbyref AsmIDArray)

Parameter

DocUid

unique id of the document to search assemblies of

Return values

The function assumes value of the last assembly found id.

If no assembly has been found the function assumes an empty string value.

LastAssemblyUid

unique id of the last assembly found.

NumOfAsm

number of assemblies found.

AsmIDArray

array containing the IDs of assemblies found.

Example

Sub main()
 dim asmarray()
 DBWInit(TRUE)
 'retrieve the currently selected document uid
 call DBWShell( "CurrentDocument" )
 if (okDBW = False) then exit sub
 docUId = DBWResult( "@DOCUMENT_UNIQUE_ID" )
 last_asm_id = DBWGetAssemblyList(DocUid, LastAsmUid, num_of_asm, asmArray)
 if last_asm_id <>"" then
  msgbox "Last asm found is " & last_asm_id & " with UID " & LastAsmUid
  if num_of_asm>1 then
   out_str = "complete list of assemblies found" & vbcrlf
   for i=1 to num_of_asm
    out_str = out_str & asmArray(i) & vbcrlf
   next
  end if
 end if
End Sub