|
<< Click to Display Table of Contents >> Navigation: Programming Mechworks PDM > DBWCommandShell > Event Scripts > CADSystem > OnSearchComponent.LST script file |
This script is fired for managing the process of getting a component path name when requested by the CAD system.
Options→Environment
@SUGGESTED_DOCUMENT_PATHNAME |
When available, it is the component's path name as suggested by the CAD system - it can be a blank value |
@DOCUMENT_UNIQUE_ID |
If returned by the script, it will set the value of the @DOCUMENT_PATHNAME and @DOCUMENT_CONFIGURATION by reading those values from the database |
|---|---|
@DOCUMENT_PATHNAME |
If returned by the script, it will force the value of the component path name to the one assigned in this parameter, no matter of the value of a previously assigned @DOCUMENT_UNIQUE_ID |
@DOCUMENT_CONFIGURATION |
If returned by the script, it will force the value of the component configuration to the one assigned in this parameter, no matter of the value of a previously assigned @DOCUMENT_UNIQUE_ID |
'.x64
.VBSCRIPT
Sub main()
DBWInit(TRUE)
suggestedDocumentPathName = DBWInput("@SUGGESTED_DOCUMENT_PATHNAME")
DBWMsgBox "Suggested document path name:" & vbcrlf & suggestedDocumentPathName
'
' implement here your own logic for getting a proper
' component path name
'
DBWShell("GetComponentFileNameFromSearchDialog")
uid = DBWResult("@DOCUMENT_UNIQUE_ID")
fileName = DBWResult("@DOCUMENT_PATHNAME")
configuration = DBWResult("@DOCUMENT_CONFIGURATION")
'
'
'
DBWOutput "@DOCUMENT_UNIQUE_ID",uid,ForWriting
DBWOutput "@DOCUMENT_PATHNAME",fileName,ForAppending
DBWOutput "@DOCUMENT_CONFIGURATION",configuration,ForAppending
End Sub