|
<< Click to Display Table of Contents >> Navigation: Programming Mechworks PDM > DBWCommandShell > Event Scripts > Database > OnUpdateDatabaseForOpenedDocument.LST script file |
available from build: 20041222
It is executed before and after the database is updated for an opened CAD or generic document,
like when saving a model in NEW state,
or when SHIFT + REFRESH
a checked-out model,
or when checking-in an opened checked-out model.
LST folder
Options→General
The purpose of the script is to let the programmer to be able to change/restore the state of the CAD model before it is processed by the database ( for example, it can switch the current configuration to a different one and then restore it with the post event ).
In order to improve the performance of the script you can use the .UIVbs version. The system checks first for the existence of the LST\OnUpdateDatabaseForOpenedDocument.LST script and then, if not found, it checks for the existence of the LST\OnUpdateDatabaseForOpenedDocument.UIvbs.
See more information on .UIvbs script here.
@CONTEXT |
UPDATE |
|---|---|
@EVENT_TYPE |
0: pre-event |
@CANCELED |
0:if the button has been pressed in the Data Input form |
@DOCUMENT_PATHNAME |
full path name of the document |
@DOCUMENT_FNAME |
file name of the document |
@DOCUMENT_FEXT |
file extension of the document |
@DOCUMENT_FDIR |
file folder of the document |
@DOCUMENT_UNIQUE_ID |
0: if the document does not already exist |
.VBSCRIPT
sub main()
DBWInit(TRUE)
context = DBWInput("@CONTEXT") ' UPDATE | CHECKIN
eventType = DBWInput("@EVENT_TYPE") ' 0 (pre-event) | 1 (post-event)
canceled = DBWInput("@CANCELED") '1 if operation canceled by the user ( only valid with @EVENT_TYPE=1 )
pathName = DBWInput("@DOCUMENT_PATHNAME")
fName = DBWInput("@DOCUMENT_FNAME")
fExt = DBWInput("@DOCUMENT_FEXT")
fDir = DBWInput("@DOCUMENT_FDIR")
uniqueId = DBWInput("@DOCUMENT_UNIQUE_ID") ' unique Id
DBWMsgBox "context=" & context & vbcrlf & "event type=" & eventType & vbcrlf &_
"path name=" & pathName & vbcrlf & "unique ID=" & uniqueId & vbcrlf &_
"canceled=" & canceled
end sub