Starting a Visual Basic Application with the Cimatron E API



Your Ad Here

As Cimatron E API uses the COM based approach, to start working with it in a Visual Basic application, you need to add references to all type libraries you going to use.

Cimatron E API uses the hierarchical object model. This means that if an object stays at the top of the hierarchy, other objects are derived from it.

These kinds of objects are the Application objects of Cimatron E API.

To get an Application object of a running active Cimatron E application, use the AppAccess object. Its interface (IAppAccess) allows you to connect to a running active Cimatron E application by returning a pointer to the IApplication interface of the Application object.

If there is no running Cimatron E application or you want to start a new one, you have to create an instance of the Application object and receive a pointer to the IApplication interface.

Once you have a pointer to the IApplication interface, you can start to execute a task of your user application.

There is no any special requirement for the type of project you can create in MS Visual Basic.

 

To start using API in your Visual Basic application you have to:

Dim gAppAccess As New AppAccess 'Define an AppAccess object to get running active application

Dim gApp As Application 'Define an Application object

Set gApp = gAppAccess.GetApplication 'Getting running active application

If gApp Is Nothing Then

'There is no running Cimatron E Application

Set gApp = New Application 'Creating new instance of Cimatron E application

End If

Return to Cimatron Index


Your Ad Here