cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

EXCEL VAB

cko
8-Gravel
8-Gravel

EXCEL VAB

- Displays the name of the currently active model
- If no model is active, a VBA error message is displayed
- I don't know if the drawing name can be displayed? test it out ^_^

Sub Model_Nanme()

      Dim asynconn As New pfcls.CCpfcAsyncConnection
      Dim conn As pfcls.IpfcAsyncConnection
      Dim session As pfcls.IpfcBaseSession
      Dim Model As pfcls.IpfcModel

      Set conn = asynconn.Connect("", "", ".", 5)
      Set session = conn.session
      Set Model = session.CurrentModel

      Call MsgBox(Model.Filename)

'// Disconnect with Creo
conn.Disconnect (2)

'// Cleanup
Set asynconn = Nothing
Set conn = Nothing
Set session = Nothing
Set Model = Nothing

End Sub

 

0 REPLIES 0
Top Tags