OnUpdateVariantNotes.LST script file

<< Click to Display Table of Contents >>

Navigation:  Programming Mechworks PDM > DBWCommandShell > Event Scripts > CADSystem >

OnUpdateVariantNotes.LST script file

Description

It is invoked every time DBWorks needs to update the variant notes of a drawing.

Its purpose is for implementing custom strategies for the updates of title blocks and/or other variant notes in a drawing template.
Typically it will be used for optimizing the performance of the standard variant notes process.

Location

LST folder

Activation

Options→General→Drawings

Input

@DRAWING_PATH_NAME

the full path name of the document (drawing or model) currently opened

@DOCUMENT_UNIQUE_ID

the current unique id of the document (drawing or model) currently opened

@PARENT_DRAWING_UNIQUE_ID

when invoked with the model being the current document, it contains the unique id of the drawing, else it is zero

Output

@OKUPDATE

can assume values of
0: invoke the Mechworks standard method for updating the variant notes
1: update is managed by the script: no need to invoke the standard method

Remarks

It is called two times: for the drawing, and then when the model is activated;
Look at the example below for how to use this script.

Please note this method is not considered optimized and the Solidworks method (based on link to custom properties) has to be the preferred one.

Example

.VBSCRIPT

sub main()
 DBWInit(TRUE)
 documentPathName = DBWInput("@DOCUMENT_PATH_NAME")
 documentUid = DBWInput("@DOCUMENT_UNIQUE_ID")
 parentDrawingUid = DBWInput("@PARENT_DRAWING_UNIQUE_ID")
 if (documentUid>0 AND parentDrawingUid=0) then
  DBWMsgBox "Drawing is processed." & vbcrlf & documentPathName & vbcrlf & documentUid
 elseif (documentUid>0 AND parentDrawingUid>0) then
  DBWMsgBox "Model is processed." & vbcrlf & documentPathName & vbcrlf & _
   documentUid & vbcrlf & "Drawing has unique id=" & parentDrawingUid
 end if
 DBWOutput "@OKUPDATE","1",ForWriting  'This directive won't perform any update of variant notes
 'DBWOutput "@OKUPDATE","0",ForWriting  'This directive will perform updating of variant notes on every sheet of the drawing
end sub

If you enable the first @OKUPDATE directive (value 1), no update will be done automatically; every action has to be written in the script.

On the other side, if you enable the second @OKUPDATE directive (value 0), the process will loop between the drawing sheets to perform automatic update of variant notes.