|
<< Click to Display Table of Contents >> Navigation: Programming Mechworks PDM > DBWCommandShell > Event Scripts > Document > OnOpen.LST script file |
It is executed every time a CAD document is opened from the a Mechworks client.
Options→Open/Save
@DOCUMENT_PATHNAME |
full path name of the opened document |
|---|---|
@DOCUMENT_FNAME |
file name part of the full path name |
@DOCUMENT_FEXT |
file extension part of the full path name |
@DOCUMENT_FDIR |
file directory part of the full path name |
@DOCUMENT_UNIQUE_ID |
when greater than 0, the unique ID of the opened document |
@EVENT_TYPE |
0: pre-event (called before opening the record) |
@OKOPEN |
0: stop opening |
The run of the script after an open event fired from the CAD or from a drag action in the CAD has been disabled to maintain compatibility with installations that already use OnOpen script for re-coding the document (OnOpenDocument is called for each components of the assembly even if not active).
The script executing sequence, when the document is part of a relationship is like follows:
1.Pre-event for main file (drawing or assembly)
2.Pre-event for each child
3.Post event for main file (drawing or assembly)
Then, if the user opens an individual child from the SolidWorks feature manager:
4.Post-event for that child
.VBSCRIPT
sub main()
DBWInit(TRUE)
pathName = DBWInput("@DOCUMENT_PATHNAME")
fname = DBWInput("@DOCUMENT_FNAME")
fext = DBWInput("@DOCUMENT_FEXT")
fdir = DBWInput("@DOCUMENT_FDIR")
uid = DBWInput("@DOCUMENT_UNIQUE_ID")
DBWMsgBox "OnOpen:" & vbCrLf &_
"Path Name=" & pathName & vbcrlf &_
"fName=" & fname & vbcrlf &_
"fext=" & fext & vbcrlf &_
"fdir=" & fdir
end sub