How to Get Active Connection in Creo VB API

How to Get Active Connection in Creo VB API

In Creo VB API application, User can easily get the active connection with Creo Session using the following function

Function – Get Active Connection

Function CCpfcAsyncConnection.GetActiveConnection  () as IpfcAsyncConnection [optional] 

If the application is connected with Creo Session then the user can utilize this function, Otherwise this function couldn’t be used.

Sample Code

Get Active Connection in VB API

Public AConnection As IpfcAsyncConnection
Public CConnection As New CCpfcAsyncConnection
    // Assign already existing connection to new connection i.e user must already used IpfcAsyncConnection to start or connect with Creo
AConnection = CConnection.GetActiveConnection()
    MessageBox.Show("Existing connection retrieved", "Success")
Catch ex As Exception
    MessageBox.Show(ex.ToString(), "Get Active Connection Failure")
End Try


  • User must already initialized the IpfcAsyncConnection for Creo Start or Connect.

Leave a Reply

Contact Us