Standard Library Global Constants

<< Click to Display Table of Contents >>

Navigation:  Programming Mechworks PDM > DBWCommandShell > Library Reference >

Standard Library Global Constants

This is a list of constants passed from Mechworks PDM to the script.

constant

return value

possibile values

note

DBWorksApplicationName

name of the application

"DBWorks"

"DBWorks Standalone"

"DBInventor"

"DBSolidEdge"

 

DBWorksDllModuleName

dll module name

DBWORKS

DBWALONE

DBInventor

DBSolidEdge

 

DBWorksCADApplicationName

name of the hosting CAD

"Standalone"

"SolidWorks"

"Inventor"

"Solid Edge"

 

MWProductName

The custom service product Name as set by the reseller in the new encrypted file <GPP>\PDMService\CustomerConfigurationData###.par







DBWorksCADApplicationVersion

version of the CAD in the format:
XX.xx.xx for Solidworks systems
XX.xxxxxxxxx for Inventor systems
XXX.xx.xx.xxx_xxx for Solid Edge systems

e.g.
19.4.0 (=Sw2011 sp4.0)
15.150309200 (=Inventor 2011 build 309 sp2)
109.00.02.004_x64 (=Solid Edge ST9 mp2 64bit)

 

MechWorksPDMVersion

version of the PDM in the format
<build> [<major> SP X.x]

e.g.
20161020 [16 SP1.1]

 

DBWorksConnectionDSN

data source name of the main database as declared in DBWCONN.PAR

 

 

DBWorksConnectionDBWCustDSN

data source name of the categories database as declared in DBWCONN.PAR

 

if not declared in dbwconn.par the default value is "DBWCUST"

DBWorksConnectionUID

User id as declared in DBWCONN.PAR

 

 

DBWorksConnectionPWD

Password as declared in DBWCONN.PAR

 

 

DBWorksConnectionDBMSName

Name of the DBMS

"ACCESS"

"Microsoft SQL Server"

"ORACLE"

the constant is set after calling the DBWInit function

DBWorksConnectionORACLE_SERVER

the name of oracle service

"__unknown__" if Oracle not running

name of Oracle service

may be empty for Personal Oracle

DBWorksConnectionExcelDSN

data source name for dbwexcel.xls as declared in DBWCONN.PAR

 

 

DBWorksConnectionBomDSN

data source name for dbwbom.xls as declared in DBWCONN.PAR

 

 

DBWorksIsInBatchOperation

Type of the operation the script is called by

1: if the current script is called from within the multiple (recursive) Checkin/Checkout/Approve dialog
0: otherwise

 

DBWorksBatchOperationDocumentsCounter

value of the counter of documents processed by the multiple Checkin/Checkout/Approve dialog

 

 

DBWorksCurrentDocumentBatchOperationIndex

index of the currently processed document in the dialog

 

the first document has a "1" value
the last document has a value equal to DBWorksBatchOperationDocumentsCounter

DBWorksIsx64

system on which DBWorks/DBInventor is running on

0: 32bit system
-1: 64bit system

typical example:

if DBWorksIsx64<>0 then ...

DBWorksEventScriptType

EVENT:<event name>
FIELD:<field name>
UTILITY:<utility script name>

EVENT: "ONOK", "ONOPEN", "ONSAVE"
FIELD: "DESCRIPTION", "CLIENT_ID"
UTILITY: "DBWDEMO"

passed to event scripts of type .LST

DBWorksScriptFullPathName

The full path name of the script that invoked the constant

C:\MechWorks_Pdm_Server\lst\Dbwdemo.vbs

 

DBWorksIsProcessingLinkedDocument

Type of document the script OnOkRev.LST is called on

1:OnOkRev.lst is being run on a Linked Document

The linked document has to be intended as a different file, so the OnokRev.LST won't be called on different configurations

 

Example

This is a useful script to print all the above constants;

Sub main()
 DBWInit(true)
 dbwmsgbox "DBWorksApplicationName: "  & DBWorksApplicationName & vbcrlf & _
 "DBWorksDllModuleName: "  & DBWorksDllModuleName & vbcrlf & _
 "DBWorksCADApplicationName: "  & DBWorksCADApplicationName & vbcrlf & _
 "DBWorksCADApplicationVersion: "  & DBWorksCADApplicationVersion & vbcrlf & _
 "MechWorksPDMVersion: "  & MechWorksPDMVersion & vbcrlf & _
 "DBWorksConnectionDSN: "  & DBWorksConnectionDSN & vbcrlf & _
 "DBWorksConnectionDBWCustDSN: "  & DBWorksConnectionDBWCustDSN & vbcrlf & _
 "DBWorksConnectionUID: "  & DBWorksConnectionUID & vbcrlf & _
 "DBWorksConnectionPWD: "  & DBWorksConnectionPWD & vbcrlf & _
 "DBWorksConnectionDBMSName: "  & DBWorksConnectionDBMSName & vbcrlf & _
 "DBWorksConnectionORACLE_SERVER: "  & DBWorksConnectionORACLE_SERVER & vbcrlf & _
 "DBWorksConnectionExcelDSN: "  & DBWorksConnectionExcelDSN & vbcrlf & _
 "DBWorksConnectionBomDSN: "  & DBWorksConnectionBomDSN & vbcrlf & _
 "DBWorksIsInBatchOperation: "  & DBWorksIsInBatchOperation & vbcrlf & _
 "DBWorksBatchOperationDocumentsCounter: "  & DBWorksBatchOperationDocumentsCounter & vbcrlf & _
 "DBWorksCurrentDocumentBatchOperationIndex: "  & DBWorksCurrentDocumentBatchOperationIndex & vbcrlf & _
 "DBWorksIsx64: "  & DBWorksIsx64 & vbcrlf & _
 "DBWorksEventScriptType: "  & DBWorksEventScriptType & vbcrlf & _
 "DBWorksScriptFullPathName: "  & DBWorksScriptFullPathName & vbcrlf & _
 "DBWorksIsProcessingLinkedDocument: " & DBWorksIsProcessingLinkedDocument & vbcrlf & _
 "MWProductName: " & MWProductName
End Sub