@A.Acheson @WCrihfield
Found a solution using the highlight.
Steps:
- Collect all parts/Assemblies in the view as componentoccurrenceproxy's.
- compare the node to the parts in the collection. Part.nativeobject. Comparing ComponentOccurrence to ComponentOccurence.
- Loop through the nodes. Once you get the component occurrence proxy, use that to get the drawing curves.
- Loop through the drawing curves and then loop through the segments on the drawing curves.
- Add the segments to the collection
- create a highlightset
- Use the AddMultipleItems on the HighLightSet to add the collection of segments
- Change the color of the set (If needed).
The trick for me was using the componentoccurrenceproxy instead of the NativeObject from the node. You have to use a proxy if you are doing sub/nodes. Nodes within nodes.
Dim oCollectComps As ObjectCollection: Set oCollectComps = CollectOcc_Iterative(oDrawView, kPartDocumentObject)
Dim oOcc As ComponentOccurrence
Dim oDrawCurve As DrawingCurve
Dim oDrawCurveSeg As DrawingCurveSegment
Dim oDrawCurves As DrawingCurvesEnumerator
Dim oCollectCurves As ObjectCollection: Set oCollectCurves = ThisApplication.TransientObjects.CreateObjectCollection
Dim oHSet As HighlightSet
For Each oNode In oCollectSelects
Set oNativeObject = oNode.NativeObject
For Each oOcc In oCollectComps
If oOcc.NativeObject Is oNativeObject Then
Set oDrawCurves = oDrawView.DrawingCurves(oOcc)
For Each oDrawCurve In oDrawCurves
For Each oDrawCurveSeg In oDrawCurve.Segments
Call oCollectCurves.Add(oDrawCurveSeg)
Next
Next
End If
Next
Next
Set oHSet = oDoc.CreateHighlightSet
oHSet.Clear
Call oHSet.AddMultipleItems(oCollectCurves)
oHSet.Color = ThisApplication.TransientObjects.CreateColor(0, 255, 0)
Tiffany Hayden
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.