Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

How to retreive model ID from its handle?

forstudy3

New member
I am working on a assembly which has some components.My intention is to retreive ID of each of the components ,I knew model name so I initialized its hanlde using -ProMdlInit() , I used this model handle in ProMdlIdGet() which I supposed will give me identifier of the model.It returns some arbitrary number as 524288 , but when I checked in model info its inernal ID is 39.

I am working on WF 5.0 M060

So is there any way to retreive internal model ID?
Edited by: forstudy3
 
You probably mean Component ID , do you?
The model can be in the assembly several times, so you need to work with components, they have own unique feature ID.
Please look to the Pro/Toolkit documentation to the chapter Assemblies ~Visiting Assembly Components. The function you are looking for is called ProSolidFeatVisit and you are searchning for PRO_FEAT_COMPONENT
 
Yes uor are right I am referring to Component ID.
is there any simple option rather than visiting each of the part compare its name with the on ethat I need and then retreive its ID.

I appreciate your help.
 
The component ID alone will not allow you to access that specific instance (no reference to family tables here) of that model. You actually need the component path. The component path is the "bread crumb" trail of feature id's from the top-level assembly down to the component. You build this path as you recursively traverse the features (components) of the assembly. _TL_ is correct. You need to call ProSolidFeatVisit on the top-level assembly, filter out all objects that are NOT of type PRO_FEAT_COMPONENT, and then retrieve the feature->id in the action function. There is a great example of this in the documentation that _TL_ mentioned.
 
Thanks for the reply.I have followed method suggested here by -narendra Kodela

http://portal.ptcuser.org/p/fo/st/thread=46337
Edited by: forstudy3
 

Sponsor

Articles From 3DCAD World

Back
Top