OnRevisionOutputFilesCreated.LST script file

<< Click to Display Table of Contents >>

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

OnRevisionOutputFilesCreated.LST script file

Description

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.

Activation

Options→Revisions→Output

Input

@DOCUMENT_UNIQUE_ID

the document unique id

@IS_CHECKIN

0: if the revision output is created on RELEASE
1: if the revision output is created on CHECKIN

@COMES_FROM_CHECKED_OUT_STATE

0: if the previous state was NEW or RELEASED
1: if the previous state was CHECKEDOUT

@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
@REVISION_OUTPUT2_FILE_NAME
@REVISION_OUTPUT3_FILE_NAME

if enabled in the options, it's the name of the file created as 1st, 2nd and 3rd revision output
in case of multiple extensions entry, it's the name of the last created one

@IS_PREVIOUS_REVISION_APPROVAL

0:if the revision output file has been created from a common forward approval
1: if the revision output file has been created from an approval process on a previous revision

@REVISION_OUTPUT1_MULTIPLE_EXTENSIONS
@REVISION_OUTPUT2_MULTIPLE_EXTENSIONS
@REVISION_OUTPUT3_MULTIPLE_EXTENSIONS

if enabled in the options, it's the entry selected as extension

Example

.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):

OptionsRevisionOutputsExt1

In this case the above example produces a message box like this:

OptionsRevisionOutputsExt2.

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.

Remarks

Please note that in case of DXF/DWG output, if Solidworks options have been set like this (so different from default)

OnRevisionOutputFilesCreatedLST01

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> ...