Quantcast
Channel: Manufacturing DevBlog
Viewing all articles
Browse latest Browse all 532

ComponentOccurrence the DrawingCurveSegment belongs to

$
0
0

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

Viewing all articles
Browse latest Browse all 532

Trending Articles