OnCreateMasterDrawing.LST script file

<< Click to Display Table of Contents >>

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

OnCreateMasterDrawing.LST script file

available from build: 20040603

Description

It is called when passing from Checkout→Checkin (with the drawing opened ): SaveAs PDF/TIFF the active drawing

Location

LST folder

Activation

The script is fired if existing and if the Master Drawing Mode is active

Input

@MASTER_DRAWING_FILE_TYPE


@MASTER_DRAWING_SUGGESTED_DIRECTORY


@MASTER_DRAWING_SUGGESTED_PATHNAME


Output

@MASTER_DRAWING_OK_RENAME


@MASTER_DRAWING_TEMPORARY_PATHNAME


@MASTER_DRAWING_PATHNAME


Example

this script has been adapted for each class of documents in order to drive correctly the application for generating a PDF file with the proper name.

.VBSCRIPT

sub main()
 DBWInit(TRUE)
 ...
 'useful inputs available
 pathName = DBWInput("@DOCUMENT_PATHNAME")
 fName = DBWInput("@DOCUMENT_FNAME")
 fExt = DBWInput("@DOCUMENT_FEXT")
 fDir = DBWInput("@DOCUMENT_FDIR")
 DocUid=DBWInput("@DOCUMENT_UNIQUE_ID")
 if masterDrawingFileType = 0 then
  ext = ".PDF"
 else
  ext = ".TIF"
 end if
 if( fExt = ".DOC" ) then
  ' manage the creation of the PDF for a .DOC
  Set fso = CreateObject("Scripting.FilesystemObject")
  fso.CopyFile <my application generated PDF file>,masterDrawingFileName
  exit sub
 end if
 ...
End sub