Model feat ID
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
Solved! Go to Solution.
- Labels:
-
ProToolkit
-
Toolkit
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Here are some helpful articles:
- "How to view the ID of a selected item in Creo Parametric": https://www.ptc.com/en/support/article/CS96624
- "How to get the session ID of a Creo Parametric model used in relation via Creo Parametric TOOLKIT?": https://www.ptc.com/en/support/article/CS151995
- "How to add Session ID for components in an Assembly Model Tree's column in Creo Parametric": https://www.ptc.com/en/support/article/CS166827
- "How to activate current window through TOOLKIT in Creo Parametric": https://www.ptc.com/en/support/article/CS288287
- "Is there a unique model ID that persists for every Creo session within a part or assembly model that can be extracted using TOOLKIT APIs in Creo Parametric?": https://www.ptc.com/en/support/article/CS311863
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you very much! You are a genius
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
