Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X
- 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