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

Highlight surface in assembly

Highlighted
Level 1

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);
ProSelectionFree(&sel);

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.
2 REPLIES 2

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);
ProSelectionFree(&p_sel);

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

Thanks.

RE: Highlight surface in assembly

Tom,
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
example.

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