Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.
Some time in a Part you required to find out some inteneded features are exist then you need to traverse the model tree corresponding part.There is significantrole of Visit functionswith in the Pro-Toolkit .
As per the Assembly is concern "Feaure" is the PART or Component. You can traverse the model tree of the given assembly using the same visit function.
Finally Visit functions are plays key role to retrieve information in a single attempt.
here is the core of the action function i use to visit members of an assembly
// Visit the features this way with this function on the current solid
ProSolidFeatVisit(solid, Action, NULL, NULL);
/*========================================================== ==========*\
FUNCTION : Action()
PURPOSE: Visit action function called for each feature
\*========================================================== ==========*/
ProError Action(ProFeature *feature, ProError filt_status, ProAppData data)
{
ProError err;
// If the feature is not active, skip it
ProFeatStatus FeatureStatus;
ProFeatureStatusGet(feature, &FeatureStatus);
if(FeatureStatus != PRO_FEAT_ACTIVE)
return(PRO_TK_NO_ERROR);
// if we are in assembly we will have component feature which contain a pointer to our part
ProFeattype FeatureType;
ProFeatureTypeGet(feature, &FeatureType);
if(FeatureType == PRO_FEAT_COMPONENT) {
// Retrieve the component feature from the assembly
ProElement FeatureTree;
err = ProFeatureElemtreeCreate(feature, &FeatureTree);
if(err == PRO_TK_NO_ERROR) {
// path to PRO_E_COMPONENT_MODEL element which contain our Part Solid
ProElempath path;
ProElempathItem path_items[2];
ProValue value;
ProValueData value_data;
ProElement part_element;
// the element exists in the tree ?
if(err == PRO_TK_NO_ERROR) {
err = ProElementValueGet(part_element, &value);
err = ProValueDataGet(value, &value_data);
// Retrieve the part
ProSolid Part = (ProSolid)(value_data.v.p);
//...
// here you can test if its a part or an assembly to ProMdlTypeGet
//...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.