Skip to main content
1-Visitor
May 30, 2013 3:49 PM UTC
Question

How to know if a feature corresponds to a part or an assembly?

Hello all,

I am wondering how to know if a ProFeature corresponds to a part or an assembly?

I know that thanks to ProFeatureTypeGet, if the type of my feature is PRO_FEAT_COMPONENT, then my feature is eather part or assembly but I would like to know exactly...

Thank you

Emilie


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.

3 replies

Emilie1-VisitorAuthor
1-Visitor
Jun 5, 2013 12:25 PM UTC

I figured it out even if it is not very very easy :

the stuff is : the feature id = the last number of the asmcomppath of the solid. And it is possible to know if a solid is a part or an assembly (getModelType). it is also possible to know if a feature correspond to something that has geometry (use ProFeatureTypeGet(), if the type is PRO_FEAT_COMPONENT then this feature correspond to geometry).

Be carefull cause this id (feature id) is not unique in the whole model. it is unique in the reference of the owner--> a model can have several parts with the same feature id.

Emilie

Translate
8-Gravel
Jun 11, 2013 12:22 PM UTC

Hello!

if (Type == PRO_FEAT_COMPONENT)

{

ProMdl Mdl;

ProMdlType MdlType;

err = ProAsmcompMdlGet(pFeature , &Mdl);

err = ProMdlTypeGet(Mdl, &MdlType);

}

Translate
Emilie1-VisitorAuthor
1-Visitor
Jun 11, 2013 1:27 PM UTC

Yes!

it is exactly this!!

Thank you, it is very easier than what I did before :-))

Emilie

Translate