|
<< Click to Display Table of Contents >> Navigation: Programming Mechworks PDM > .NET API > MWAPI introduction |
MechWorks .NET API
The .NET API approach can be used to implement general scripting.
With respect of previous scripting, the DBWInit is replaced by the MwPDMApi.Initialize object: the StartConnection method manages the connection management to the running DBWorks, giving back the related MwPDMApi.Application object that exposes the PDM object model system implementing all the existing DBWShell/DBWLib functionalities.
As an example, the layout code of a new .vbs or .vb file is:
'.x64
sub main()
'Create instance of Initialize object
Set pDBWInit = CreateObject("MwPDMApi.Initialize")
'start connection with running DBWorks, getting the Application object to access the PDM object model
Set pDBWAppl = pDBWInit.StartConnection(DBWorksApplicationName)
'...
pDBWInit.EndConnection
End Sub
See how to implement Utility scripting using Event Scripting