Showing results for 
Search instead for 
Did you mean: 
Showing results for 
Search instead for 
Did you mean: 

Highlight surface in assembly


Highlight surface in assembly

I'm having trouble figuring out how to highlight a particular surface on a particular part within an assembly. The code I have is something like this:

ProSurfaceToGeomitem(part, surface, &geom);
ProSelectionAlloc(&comp_path, &geom, &sel);
ProSelectionHighlight(sel, PRO_COLOR_HIGHLITE);

The problem I'm having is getting the component path (comp_path). Since this is an assembly, I need the right comp_path for the highlight to appear correctly. How do I get the right component path?

Thanks in advance.

re: Highlight surface in assembly

Here's a little more information. I'm searching all surfaces in all parts within an assembly, looking for surfaces with particular characteristics. So, in the code I showed, I have the part that the surface belongs to.

Previously, I let the user select a part, then I got the component path using something like this:

ProSelect("part", 1, NULL, NULL, NULL, NULL, &p_sel, &n_sel);
ProSelectionAsmcomppathGet(p_sel[0], &comp_path);

And this worked. But what I want to do now is search all parts and get the component path of each. I tried something like this:

ProMdlToModelitem(part, &part_item);
ProSelectionAlloc(NULL, &part_item, &p_sel);
ProSelectionAsmcomppathGet(p_sel, &comp_path);

But this doesn't work. The component path isn't right. What am I doing wrong?


RE: Highlight surface in assembly

In order to search for all parts you need to call ProSolidFeatureVisit
on the assembly (parts are features in an assembly). The feature id of
each part is a line in the component path table. Look in the API Wizard
under User's Guide->Assemblies->Visiting Assembly Components for an

Patrick Williams | Sr. Application Engineer | CAM Systems | Steelcase
Inc. | 616.698.4078