|
<< Click to Display Table of Contents >> Navigation: Programming Mechworks PDM > DBWCommandShell > Script parameters > I/O parameters for DBWorks scripts |
This script is called for starting the Material Wizard
<NAME_FIELD_VOLUME> |
volume value in m3 |
|---|---|
@COMPUTE_WEIGHT |
<0/1> |
<NAME_FIELD_WEIGHT> |
weight value in Kg |
|---|---|
@DENSITY |
density value in Kg/m3 |
These scripts are called when pressing a field right-button in the edit form mask.
<any field name> |
value of the field |
|---|---|
@EDIT |
<0/1> |
@PROJECT1 |
project the documents belongs to |
@PROJECT2 |
project the documents belongs to |
@PROJECT... |
project the documents belongs to |
@PROJECTN |
project the documents belongs to |
@CURRENT_PROJECT |
the currently activated project |
Special case when a drawing is being saved:
Remarks: a drawing saves its own record and that ones of the document being saved.
When saving the drawing's own record
@DRAWING_UNIQUE_ID |
drawing unique id |
|---|---|
@DOCUMENT_UNIQUE_ID |
0 |
When saving any drawn document's record
@DRAWING_UNIQUE_ID |
drawing unique id |
|---|---|
@DOCUMENT_UNIQUE_ID |
part/assembly unique id |
@CURRENT_PROJECT |
the project to be activated in DBWorks |
|---|---|
@DENSITY |
density value in Kg/m3 |
<any field name> |
value of the field |
This script is executed each time an event occurs (checkin, checkout,...)
@TRANSACTION_TYPE |
"INSERT" |
|---|---|
@TRANSACTION_SQL_CMD |
sql command to be executed |
When availables:
@TRANSACTION_DOCUMENT_ID |
document id |
|---|---|
@TRANSACTION_DOCUMENT_TYPE |
document type |
This script is executed when pressing the Save Wizard tool bar button
@DOCUMENT_TYPE |
document type |
|---|---|
@DOCUMENT_UNIQUE_ID |
document unique id |
@DOCUMENT_OWNER_UNIQUE_ID |
returns the unique id of the parent document (for example when inserting a new component from within an assembly) |
Special case: when a drawing is being saved with the option 'Use same part id for drawings on save as'
@DOCUMENT_PATHNAME |
path name of the drawn document |
|---|---|
@DOCUMENT_FNAME |
file name of the drawn document |
@DOCUMENT_FEXT |
file extension of the drawn document |
@DOCUMENT_FDIR |
file directory of the drawn document |
@DOCUMENT_CONFIGURATION |
configuration of the drawn document |
@DRAWING_FNAME |
file name of the drawing itself |
DRAWING_FDIR |
file directory of the drawing itself |
This script is executed when pressing the Open Wizard tool bar button
@MODE |
<0/1> |
This script is executed when pressing the Advanced Filter tool bar button
@MODE |
<0/1> |
This script is executed each time a Microsoft Excel output is requested
@XLS_DOCUMENT |
path name of the created .XLS file |
This script is executed when a new revision will be created
@LAST_REVISION |
"" (empty string) if it is the FIRST revision |
|---|---|
last revision of the document otherwise |
|
@MODELESS |
<0/1> |
@DOCUMENT_UNIQUE_ID |
the document unique id |
This script is executed when the user presses the OK button in the Data Input Form. It receives as input all the field values, then returns @OKDATA variable.
exactly the same as in a GENERIC.LST
@OKDATA |
<0/1> |
script example:
.VBSCRIPT
Sub Main()
DBWInit(TRUE)
descr = DBWInput("DESCRIPTION")
if decr = "Made by MechWorks" then
DBWOutput "@OKDATA",1,ForWriting
else
DBWMsgBox "The description must be exactly 'Made by MechWorks'"
DBWOutput "@OKDATA",0,ForWriting
end if
end sub
In the above trivial script, the validation is negated if the field DESCRIPTION is not exactly equal to a dummy value.
This script is executed when the user presses the CANCEL button in the Data Input Form. It receives as input all the field values; it returns no data.
exactly the same as in a GENERIC.LST
This script is executed when the user presses the OK button in the Revision Data Input Form. It receives as input all the field values, then returns @OKDATAREV variable.
exactly the same as in a GENERIC.LST
@ONOKREV |
<0/1> |
script example:
.VBSCRIPT
Sub Main()
DBWInit(TRUE)
appr = DBWInput("APPROVED_BY")
if appr = "" then
DBWOutput "@OKDATAREV",1,ForWriting
exit sub
end if
'
'here is the handling of the "Approve Revision" case
'
notes = DBWInput("NOTES")
if notes = ""
DBWMsgBox "You must fill the NOTES field before approving!"
DBWOutput "@OKDATAREV",0,ForWriting
else
DBWOutput "@OKDATAREV",1,ForWriting
end if
end sub
In the above script, the approval of the revision is negated if the field NOTES is left empty.
This script is executed when the user presses the CANCEL button in the Revision Data Input Form. It receives as input all the revision field values; it returns no data.
exactly the same as in a GENERIC.LST