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

Try
    // 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

Note:

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

 

Thanks & Regards

Parthiban Kannan

Follow me on LinkedIn!

Share Now
  •  
  •  
  •  
  •  
  •  
  •  

Leave a Reply