DBWCheckIfDrawingExists2

<< Click to Display Table of Contents >>

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

DBWCheckIfDrawingExists2

Description

Check if a drawing related to the specify part/assembly exists; it's similar to DBWCheckIfDrawingExists but it also returns an array containing unique ids of found drawings.

Syntax

Function DBWCheckIfDrawingExists2(Part_Asm_Uidbyref DrawingUidbyref num_of_drawbyref drawIdArraybyref drawUidArray)

Parameters

Part_Asm_Uid

is the part or assembly unique id

Return Values

The function assumes the value of the last (if more than one) drawing found or empty string if no drawing exist.

DrawingUid

contains the the unique id of the drawing; in case of more than one it contains the last one.

num_of_draw

contains the number of drawings found

drawIdArray

is an array containing ids of drawings found

drawUidArray

is an array containing UIDs of drawings found

See also

DBWCheckIfDrawingExists function.

Example

DBWShell("CurrentDocument")
uid = DBWInput("@DOCUMENT_UNIQUE_ID")
Dim drawIdArray()
Dim drawingUIDArray()
if DBWCheckIfDrawingExists2(uid, DrawingUid, numofdrawings, drawIdArray, drawingUIDArray)<>"" then
 for i=0 to Ubound(drawIdArray)-1
  msgString = msgString & vbcrlf & drawIdArray(i) & " - uid=" & drawingUIDArray(i)
 next
 DBWMsgBox cstr(numofdrawings) & " drawing(s) found:" & vbcrlf & msgString
else
 DBWMsgBox "No drawings found"
end if