Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Hi,
I have a list in Excel with model numbers to load in Creo via the vba api. The models reside in Windchill. How can I do this ?
I tryed next but this does not work:
Dim model As IpfcModel
Set model = gSession.GetModel("48603102.PRT", EpfcModelType.EpfcMDL_PART)
If Not model Is Nothing Then model.Display
Any help is appreciated.
Regards,
Bernard
Found it after looking into Excel attachments :
'Create a modeldescriptor to the Pro/E Model
Dim oModelDescriptorCreate As New CCpfcModelDescriptor
Dim oModelDescriptor As IpfcModelDescriptor
Set oModelDescriptor = oModelDescriptorCreate.Create(EpfcMDL_PART, sNumber, Null)
'Retrieve the model into the oModel handle
Set model = gSession.RetrieveModel(oModelDescriptor)
'Create a new window which displays the Pro/E Model
Dim oWindow As pfcls.IpfcWindow
Set oWindow = gSession.OpenFile(oModelDescriptor)
'Activate the new window
oWindow.Activate