I/O parameters for DBWorks scripts

<< Click to Display Table of Contents >>

Navigation:  Programming Mechworks PDM > DBWCommandShell > Script parameters >

I/O parameters for DBWorks scripts

Input/Output parameters for DBWorks scripts

 

LST\<NAME_FIELD_MATERIAL>.LST

This script is called for starting the Material Wizard

from DBWorks to MATERIAL.EXE

<NAME_FIELD_VOLUME>

volume value in m3

@COMPUTE_WEIGHT

<0/1>

 
from MATERIAL.EXE to DBWorks

<NAME_FIELD_WEIGHT>

weight value in Kg

@DENSITY

density value in Kg/m3

 

Generic LST\*.LST

These scripts are called when pressing a field right-button in the edit form mask.

from DBWorks to the script

<any field name>

value of the field

@EDIT

<0/1>
0: insert a new record
1: update an existing record

@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

 
from script to DBWorks

@CURRENT_PROJECT

the project to be activated in DBWorks

@DENSITY

density value in Kg/m3

<any field name>

value of the field

LST\DBWTran.LST

This script is executed each time an event occurs (checkin, checkout,...)

from DBWorks to DBWTRAN.LST

@TRANSACTION_TYPE

"INSERT"
"DELETE"
"UPDATE"

@TRANSACTION_SQL_CMD

sql command to be executed

When availables:

@TRANSACTION_DOCUMENT_ID

document id

@TRANSACTION_DOCUMENT_TYPE

document type

LST\DATAENTR.LST

This script is executed when pressing the Save Wizard tool bar button

from DBWorks to DATAENTR.LST

@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

LST\OPENDOC.LST

This script is executed when pressing the Open Wizard tool bar button

from DBWorks to OPENDOC.LST

@MODE

<0/1>
0: run a simple script
1: run as Open Wizard

LST\ADVFILTER.LST scripts

This script is executed when pressing the Advanced Filter tool bar button

from DBWorks to ADVFILTER.LST

@MODE

<0/1>
0: run a simple script
1: run as Open Wizard

LST\VIEWXLS.LST

This script is executed each time a Microsoft Excel output is requested

from DBWorks to VIEWXLS.LST

@XLS_DOCUMENT

path name of the created .XLS file

LST\ONNEWREV.LST

This script is executed when a new revision will be created

from DBWorks to ONNEWREV.LST

@LAST_REVISION

"" (empty string) if it is the FIRST revision

last revision of the document otherwise

@MODELESS

<0/1>
0: a dialog is displayed for input
1: dialog is running in a modeless way

@DOCUMENT_UNIQUE_ID

the document unique id

 

LST\ONOK.LST

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.

from DBWorks to ONOK.LST

exactly the same as in a GENERIC.LST

from ONOK.LST to DBWorks

@OKDATA

<0/1>
0: avoid validation
1: confirms the validation of the data

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.

 

LST\ONCANCEL.LST

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.

from DBWorks to ONCANCEL.LST

exactly the same as in a GENERIC.LST

 

LST\ONOKREV.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.

from DBWorks to ONOKREV.LS

exactly the same as in a GENERIC.LST

from ONOKREV.LST to DBWorks

@ONOKREV

<0/1>
0: avoid validation
1: confirms the validation of the revision data

 

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.

 

LST\ONCANCELREV.LST

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.

from DBWorks to ONOK.LST

exactly the same as in a GENERIC.LST