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

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

How to load a model from Windchill in Creo via vba api

BernardWielfaer
12-Amethyst

How to load a model from Windchill in Creo via vba api

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

1 REPLY 1

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

Announcements
Business Continuity with Creo: Learn more about it here.

Top Tags