Data Management - VB Example



Your Ad Here

Open/Save/Close CimatronE document

VB Sample project

 

The following example demonstrates how to open a New Document, Save an active document, Close an active document and Open an existing document in Cimatron E using the API Suite classes.

1. Open a new VB project (Standard EXE) in Visual Basic.

2. Add a command button to Form1.

3. Paste the following code into Form1:

Private Sub Command1_Click()

  ' Open new document by input:

  ' Doc Name, Type of document, Units if document.

  gSuite.DM.CreateNewDocument "New Doc Name", suPart, suMillimeter

  ' Save the active document

  gSuite.DM.SaveActvDoc

  ' Close the active document

  gSuite.DM.CloseActvDoc

  ' Open the Existing Document (The one that we created and saved before)

  gSuite.DM.OpenExistingDoc "Saved Doc Name", suPart, suMillimeter

End Sub

4. Press the F5 key to run the project or in the Tools menu, click Run Project.

Return to Cimatron Index


Your Ad Here