HighlightSet in "in-place" part edit not working

HighlightSet in "in-place" part edit not working

jan.pomplun
Contributor Contributor
489 Views
1 Reply
Message 1 of 2

HighlightSet in "in-place" part edit not working

jan.pomplun
Contributor
Contributor

I open a part via ComponentOccurence.Edit() "in-place" within an assembly. The HighlightSet does not seem to work for this case.

Is something wrong with following code? It does not throw any error and the loops over the part features and faces work. However nothing is highlighted

 

 

HighlightSet highlightSet = InventorUtil.InventorApplication.ActiveEditDocument.CreateHighlightSet();
highlightSet.Color = InventorUtil.InventorApplication.TransientObjects.CreateColor(0, 255, 0);

 

PartDocument pd = (PartDocument)InventorUtil.InventorApplication.ActiveEditDocument;
foreach (PartFeature feat in pd.ComponentDefinition.Features)
      foreach (Face face in feat.Faces)
                    highlightSet.AddItem(face);

0 Likes
490 Views
1 Reply
Reply (1)
Message 2 of 2

etaCAD
Advocate
Advocate

I think you have to work with proxies when you are in edit mode.

The highlightset is part of your main assembly and the selected faces don't exist in the context of the assembly. So you have to create proxies. I faced this issue with parts and in an subassembly and solved it like this:

 

Dim newObject As Object = Nothing
Dim parent As ComponentOccurrence = oOccurrence.ParentOccurrence
parent.CreateGeometryProxy(oOccurrence, newObject)
' newObject is now oOccurrence in context of ParrentOccurrence and you can add it to the highlight set

This is just an idea. For sure you have to modify this code to work also with faces.

 

Andreas

 

Andreas
etaCAD

0 Likes