<?xml encoding=”UTF-8″>By Adam Nagy
If you want to find out which ComponentOccurrence of the assembly a given DrawingCurve/DrawingCurveSegment belongs to then you can find it like so:
Sub GetOccurrenceFromDrawingCurveSegment()
' First select a drawing curve segment in
' one of the views that is showing an assembly
' If the curve is related to geometry
' inside a subcomponent then that suboccurrence
' in the assembly will be retrieved
Dim dcs As DrawingCurveSegment
Set dcs = ThisApplication.ActiveDocument.SelectSet(1)
Dim ep As EdgeProxy
Set ep = dcs.Parent.ModelGeometry
Dim co As ComponentOccurrence
Set co = ep.ContainingOccurrence
MsgBox (co.Name)
End Sub

Leave a Reply