OnOpen.LST script file

<< Click to Display Table of Contents >>

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

OnOpen.LST script file

Description

It is executed every time a CAD document is opened from the a Mechworks client.

Activation

Options→Open/Save

Input

@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)
1: post-event (called after the record opening)

Output

@OKOPEN

0: stop opening
1: procede with opening the document in the CAD

Remarks

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

See also

OnOpenG.LST

Example

.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