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: 

Polygons to circles

Message 1 of 6
1440 Views, 5 Replies

Polygons to circles



I got dxf files from client. Files created in Sketchup. All circles are polygons. Is there any way how to convert polygons to circles in Fusion 360?


I know that in Autocad have a script for it. Maybe some of you have experience. 


Thank you in advance!



Tags (1)
Labels (3)
Message 2 of 6
in reply to: janis-krums

There isn't any built-in functionality to Fusion to help with this but it should be possible to write a script to do it. If the polygons are full circles, it should be fairly easy.  The main thing needed is to know how the polygon represents the circle.  For example, does the polygon fit within the original circle, or is it outside the circle, or something else.  It's still possible but gets trickier if the polygons represent connected arcs and lines.  Determining where an arc or line ends and the next one starts takes some more logic.

It will probably be best if you can post an example file here and how the polygon represents the circle so we can all see what data you have and see how you might best create the desired geometry.

Brian Ekins
Inventor and Fusion 360 API Expert
Message 3 of 6
in reply to: janis-krums



Thank you for reply. File example in attachment.

Message 4 of 6
in reply to: janis-krums

Hi @janis-krums .


It looked like fun, so I gave it a try.
Let me tell you beforehand that the processing speed is very slow.


I decided to make it a circumscribed circle for the polygon.
Find a polygon in the specified sketch that can be determined to be a hole, change the polygon to construction, and add a circle.


The script I created is too long, so I have attached it.


Here is the result of trying the DXF file I attached.


Due to the low performance of my PC, it could be processed in less time.

・・・However, needing about 20 minutes to draw 128 circles is too slow.


As an excuse, the progress dialog appears twice.
The first time it is looking for a polygon that can be converted, and the second time it is drawing a circle.
I feel that the cause of the slow processing speed is probably the access to the sketch entity.

Message 5 of 6
in reply to: kandennti

Improved the processing speed and published it here.

Fusion360 Polygons To Circles 


Here are the main changes.

・Changed to add-in
・Improvement of processing speed
・Circle fitting by least-squares method
・Support for Japanese

Message 6 of 6
in reply to: janis-krums

Thank you for help. It really helped solve the problem.  

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

Post to forums  

Technology Administrators

Autodesk Design & Make Report