Create Connection ID in VB API
Connection ID is playing the important role in VB API application to connect the required Creo session from multiple Creo Session. Since VB API application can connect to one instance of Creo session at the time, it is important to Create connection ID to connect and reconnect the Creo
Syntax to Create Session ID
Create Connection ID – syntax
Function CCpfcConnectionId.Create (ExternalRep as String) as IpfcConnectionId
The Creo Parametric session identification string.
The connection id handle.
- Declare the variable for IpfcAsyncConnection & CCpfcAsyncConnection
- Get Connection ID string from IpfcAsyncConnection
- Create Connection ID from CCpfcAsyncConnection
Create Connection ID from Creo Session ID String
Public AConnection As IpfcAsyncConnection Public CConnectionID As CCpfcConnectionId Try AConnection = CConnection.Connect(Nothing, Nothing, Nothing, 10) Dim ConnectionString As String = AConnection.GetConnectionId.ExternalRep.ToString() CConnectionID.Create(ConnectionString) MessageBox.Show("Connection ID: " & ConnectionString & " Created", "Success") Catch ex As Exception MessageBox.Show(ex.ToString(), "Connection ID Creation Failure") End Try