|
<< Click to Display Table of Contents >> Navigation: Programming Mechworks PDM > Scripting in MechworksPDM > Scripting in MechworksPDM |
The extension/directive .MWNET is a specific MechworksPDM method to execute compiled (MWPDMEvents) .NET code with no vbs engine support.
The extension .mwnet is recognized in the LST_DIR folder and scripts will be shown in the Tools → Utility menu. Such script must be an empty file named <script_name>.mwnet (the trigger for execution is the presence of such script rather than its content).
Similarly, in the right mouse button menu on an assembly, part, drawing or project it is possible to add commands creating .mwnet scripts in the LST\(A|P|D|0|G) folder (respectively).
.SPT and .LST files can be .NET scripts too: the first line must be a .MWNET directive (similar to the legacy .VBSCRIPT directive).
OnOk.LST content for .NET (OnOk class in MWPDMWEvents) script must be like followings:
.MWNET
The .MWNET directive for .lst/.spt definition allows now the possibility to drop-in specific event execution.
The extended format is:
.MWNET [objectName]
where [objectName], if specified, must match the DBWorksEventScriptType specification + implementation_class (EVENT:XXX or FIELD:YYY or FIELD_SPT:KKK or UTILITY:ZZZ) in MwPDMEvents.dll.
Specific event execution (OnOk_SW class in MWPDMWEvents) is performed in case of OnOk.lst content like:
.MWNET EVENT:OnOk_SW