Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Obtain Sketch from an extrude feature

Message 1 of 2
387 Views, 1 Reply

Obtain Sketch from an extrude feature

How can I get the sketch that was used for the creating of an extrude cut feature?
I tried using the extrudeFeature.profile.parentSketch function however it doesn't give me what I wanted.
In the example below, I just want the sketch of the triangular extrude cut feature, so a triangular sketch.triangle.jpg



However, when using the extrudeFeature.profile.parentSketch function, I get the following:




The result is a sketch that consists of the square surface, the triangular cut and a line that connects them both. I just want the sketch that was used for creating the extrude cut, nothing else. How can I accomplish this?

Message 2 of 2
in reply to: jmperez6

There probably isn't a sketch that just contains the triangle.  When creating an extrusion, or any feature that uses a sketch for the shape, you're not selecting the sketch but a profile within a sketch.  For example, you can create a sketch and then draw a circle, a triangle, and a rectangle.  Now when you create an extrusion it will prompt you select a profile and you could select any one of those shapes or even multiple shapes.


It's also possible that the profile shape may not have a one-to-one correspondence to the geometry in the sketch.  For example, in the picture below I drew a rectangle and a circle, so the sketch contains one circle and four lines.  However, Fusion 360 finds where sketch entities intersect and calculates those areas which are referred to as "profiles".  I've colored each of the profiles that exist in the sketch.  Each profile is made up of one or two lines and an arc.  These lines and arcs don't exist in the sketch but are only part of the profile.  Querying the profile, I can find out that it's geometry consists of a line and I can find out which sketch line it was derived from, but the line that's part of the profile has different geometry than the sketch line.


Brian Ekins
Inventor and Fusion 360 API Expert

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th

Autodesk Design & Make Report