Skip to main content
1-Visitor
Nov 22, 2021 3:18 PM UTC
Solved

Model feat ID

Hello,

 

Do you know how to get model ID in an assembly.

I tried ProMdlIdGet but it gives me the ID of the model part  separated from the assembly. And when the model part has the same name but not the same placement, it always gives me the same ID.

Well, how to get those feat ID in the picture?

I have the assembly model, the list of part model, the ProAsmcomppath.

 

Thank you very much.

 

@MichelH @YaroslavSin @rghadge

 

finalresultCreo.png 

RPN
RPNAnswer
18-Opal
Nov 22, 2021 10:07 PM UTC

You can‘t have the same assembly in session with different feature ids. So the component path is here not a question. This call will convert the feature Id / Component to a model. The model item owner is always the parent assembly.


extern ProError ProAsmcompMdlGet (ProAsmcomp *p_feat_handle,
ProMdl *p_mdl_handle);
/*
Purpose: Retrieves the component model, given a component feature.

Input Arguments:
p_feat_handle - The handle to the component feature

Output Arguments:
p_mdl_handle - The model handle to be initialized

Return Values:
PRO_TK_NO_ERROR - The argument corresponds to a valid component
feature with a valid component model.
PRO_TK_BAD_INPUTS - The specified feature is not a valid component
feature.
PRO_TK_E_NOT_FOUND - Assembly component model is not a solid or
is not in memory.

4 replies

24-Ruby IV
Nov 22, 2021 6:32 PM UTC

Here are some helpful articles:

 

Translate
RPN
RPN18-OpalAnswer
18-Opal
Nov 22, 2021 10:07 PM UTC

You can‘t have the same assembly in session with different feature ids. So the component path is here not a question. This call will convert the feature Id / Component to a model. The model item owner is always the parent assembly.


extern ProError ProAsmcompMdlGet (ProAsmcomp *p_feat_handle,
ProMdl *p_mdl_handle);
/*
Purpose: Retrieves the component model, given a component feature.

Input Arguments:
p_feat_handle - The handle to the component feature

Output Arguments:
p_mdl_handle - The model handle to be initialized

Return Values:
PRO_TK_NO_ERROR - The argument corresponds to a valid component
feature with a valid component model.
PRO_TK_BAD_INPUTS - The specified feature is not a valid component
feature.
PRO_TK_E_NOT_FOUND - Assembly component model is not a solid or
is not in memory.

Translate
1-Visitor
Nov 23, 2021 9:17 AM UTC

Thank you very much! You are a genius

Translate
17-Peridot
Nov 23, 2021 9:17 AM UTC

Feat ID = Component ID.

If you have ProAsmcomppath for each component of the assembly. Then the last ID in the id_table array - is a ID for this component.

Translate