Can I obtain a part feature from DrawingCurve Object?

Can I obtain a part feature from DrawingCurve Object?

Eric.Mathews120
Contributor Contributor
560 Views
1 Reply
Message 1 of 2

Can I obtain a part feature from DrawingCurve Object?

Eric.Mathews120
Contributor
Contributor

Is there a direct path to a part feature from a DrawingCurve object?

 

I know the following is possible, but it's slow.

EdgeProxy _edgeProxy = _curveObject.Curve.ModelGeometry;

PartDocument _prtDoc = _edgeProxy.ContainingOccurrence.Definition.Document;
foreach (PartFeature _partFeature in _prtDoc.ComponentDefinition.Features)
     {
        // Interrogate features          
     }

 

Thanks...

0 Likes
Accepted solutions (1)
561 Views
1 Reply
Reply (1)
Message 2 of 2

BrianEkins
Mentor
Mentor
Accepted solution

There's not a direct link between a drawing curve and a feature.  Typically a drawing curve is a representation of an edge and edges aren't considered to be created by a feature but are the result of the intersection of two faces.  The most direct route to the feature when the part is in an assembly like in your example.

 

  1. DrawingCurve.ModelGeometry which will return either an EdgeProxy or FaceProxy object.
  2. Use the NativeObject property to get the Edge or Face in the part.
  3. If it's a Face use the CreatedByFeature property to get the feature that created the face.
  4. If it's an edge, use the Faces property of the Edge to get the two faces it joins and use their CreatedByFeature property to get the feature(s) that created the faces.  If it's two different features you'll have to use some other logic to decide which one to use.  Probably the last of the two in the browser.

 

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes