Can I check if a BRepEdge is straight? (Or can i cast to a SketchLine and do the test)

Can I check if a BRepEdge is straight? (Or can i cast to a SketchLine and do the test)

sylvain_boyer6TGNB
Enthusiast Enthusiast
471 Views
2 Replies
Message 1 of 3

Can I check if a BRepEdge is straight? (Or can i cast to a SketchLine and do the test)

sylvain_boyer6TGNB
Enthusiast
Enthusiast

As defined in the question. I am looking to discriminate straight edge (can be selected) to curved one. 

 

0 Likes
Accepted solutions (1)
472 Views
2 Replies
Replies (2)
Message 2 of 3

BrianEkins
Mentor
Mentor
Accepted solution

The BRepEdge object supports the geometry property. This will return different types of objects depending on the shape of the edge. You'll want to check if you get back a Line3D object.

if edge.geometry.objectType == adsk.core.Line3D.classType():
    app.log('Edge is linear')
else:
    app.log('Edge is NOT linear')
---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes
Message 3 of 3

sylvain_boyer6TGNB
Enthusiast
Enthusiast

Many Thanks !

0 Likes