Community
Hi
I got stuck with my code at the point where I want to get access to the occurrence that has a DrawingCurveSegment selected by user with Pick method. So the user selects the edge of a part in drawingview and based on that drawingcurvesegment Inventor must color all the occurence drawing curves using DrawingCurve.Color.
To reach all the drawingcurves of that occurrence I need to get the occurence. But how do I do that? Any ideas?
Thanks
Alexandru
Hello,
You should be able to get the occurrence from ModelGeometry of the selected curve.
I was able to color the edges of an occurrence in an assembly view with this code:
Dim oDoc As DrawingDocument Set oDoc = ThisApplication.ActiveDocument Dim oCurveSeg As DrawingCurveSegment Set oCurveSeg = oDoc.SelectSet.Item(1) Dim oCurve As DrawingCurve Set oCurve = oCurveSeg.Parent Dim oEdge As EdgeProxy Set oEdge = oCurve.ModelGeometry Dim oCompOccurrence As ComponentOccurrence Set oCompOccurrence = oEdge.ContainingOccurrence Dim oDrawingView As DrawingView Set oDrawingView = oCurve.Parent Dim oDrawingCurves As DrawingCurvesEnumerator Set oDrawingCurves = oDrawingView.DrawingCurves(oCompOccurrence) Dim oColor As Color Set oColor = ThisApplication.TransientObjects.CreateColor(255, 0, 0) For Each oCurve In oDrawingCurves oCurve.Color = oColor Next