|
<< Click to Display Table of Contents >> Navigation: Programming Mechworks PDM > DBWCommandShell > Event Scripts > Revision > OnRevisionOutputFilesCreated.LST script file |
This script is executed AFTER the creation of each set of output files.
It may be useful for copying specific output files in some other folders, that, as an example, might be kept synchronized using a cloud utility.
Options→Revisions→Output
@DOCUMENT_UNIQUE_ID |
the document unique id |
|---|---|
@IS_CHECKIN |
0: if the revision output is created on RELEASE |
@COMES_FROM_CHECKED_OUT_STATE |
0: if the previous state was NEW or RELEASED |
@EXCEL_BOM_OUTPUT_FILE_NAME |
if enabled in the options, it's the name of the BOM created as revision output |
@REVISION_OUTPUT1_FILE_NAME |
if enabled in the options, it's the name of the file created as 1st, 2nd and 3rd revision output |
@IS_PREVIOUS_REVISION_APPROVAL |
0:if the revision output file has been created from a common forward approval |
@REVISION_OUTPUT1_MULTIPLE_EXTENSIONS |
if enabled in the options, it's the entry selected as extension |
.vbscript
Sub main()
DBWInit(TRUE)
uniqueId = DBWInput("@DOCUMENT_UNIQUE_ID")
isCheckin = DBWInput("@IS_CHECKIN")
comesFromCheckedOutState = DBWInput("@COMES_FROM_CHECKED_OUT_STATE")
excelBomOutputFileName = DBWInput("@EXCEL_BOM_OUTPUT_FILE_NAME")
Output1File = DBWInput("@REVISION_OUTPUT1_FILE_NAME")
Output2File = DBWInput("@REVISION_OUTPUT2_FILE_NAME")
Output3File = DBWInput("@REVISION_OUTPUT3_FILE_NAME")
Output1Ext = DBWInput("@REVISION_OUTPUT1_MULTIPLE_EXTENSIONS")
Output2Ext = DBWInput("@REVISION_OUTPUT2_MULTIPLE_EXTENSIONS")
Output3Ext = DBWInput("@REVISION_OUTPUT3_MULTIPLE_EXTENSIONS")
DBWMsgBox(_
"uniqueId=" & uniqueId & vbcrlf &_
"isCheckin=" & isCheckin & vbcrlf &_
"comesFromCheckedOutState=" & comesFromCheckedOutState & vbcrlf &_
"excelBomOutputFileName=" & excelBomOutputFileName & vbcrlf &_
"Output1File=" & Output1File & vbcrlf &_
"Output2File=" & Output2File & vbcrlf &_
"Output3File=" & Output3File & vbcrlf &_
"Output1Ext=" & Output1Ext & vbcrlf &_
"Output2Ext=" & Output2Ext & vbcrlf &_
"Output3Ext=" & Output3Ext _
)
End Sub
Suppose you have set the option like followings with only one multiple output (PDF+TIF+DWG):

In this case the above example produces a message box like this:
.
Please note the Output1File returns the LAST file created (in this case the .DWG), while the Output1Ext returns the ouptut extension as defined in the DBWRevisionsOutputFileExtensions.txt definition file.
Please note that in case of DXF/DWG output, if Solidworks options have been set like this (so different from default)

the script will receive as input the output file name in its single-sheet format <DrawingFileName.DXF/DWG> while the CAD will produce numbered outputs like <00_DrawingFileName.DXF/DWG>
<01_DrawingFileName.DXF/DWG> ...