Data Management - VB Example



Your Ad Here

Get Document information

VB Sample project

 

The following example demonstrates how to get Document information from Cimatron E using the API Suite classes.

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

  2. Add a command button & six Text Box to Form1.

  3. Paste the following code into Form1:

Private Sub Command1_Click()

  ' Get Active document Title

  Text1.Text = gSuite.DM.GetActvDocTitle

  ' Get Active document Description

  Text2.Text = gSuite.DM.GetActvDocDescription

  ' Get Active document Units

  If gSuite.DM.GetActvDocUnits = suMillimeter Then

  Text3.Text = "Millimeter"

  ElseIf gSuite.DM.GetActvDocUnits = suInch Then

  Text3.Text = "Inch"

  Else

  Text3.Text = "Error"

  End If

  ' Get Active document Type

  If gSuite.DM.GetActvDocType = suPart Then

  Text4.Text = "Part"

  ElseIf gSuite.DM.GetActvDocType = suAssembly Then

  Text4.Text = "Assembly"

  ElseIf gSuite.DM.GetActvDocType = suDrafting Then

  Text4.Text = "Drafting"

  ElseIf gSuite.DM.GetActvDocType = suNc Then

  Text4.Text = "NC"

  Else

  Text4.Text = "Error"

  End If

  ' Get Active document PID

  Text5.Text = gSuite.DM.GetActvDocPID

  ' Get Active document Version

  Text6.Text = gSuite.DM.GetActvDocVersion

End Sub

  1. Press the F5 key to run the project or on the Tools menu, click Run Project.

Return to Cimatron Index


Your Ad Here