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: 

Trouble with spline to polyline add-in.

Message 1 of 12
434 Views, 11 Replies

Trouble with spline to polyline add-in.

Hi y'all!


 I posted a question in another forum, and it was suggested that I should maybe give it a try over here.


I recently downloaded the Spline to Polyline add-in and when I run it, I get this error message:



Traceback (most recent call last):

File "/Users/devonmccauley/Library/Containers/com.autodesk.mas.fusion360/Data/Library/Application Support/Autodesk/ApplicationPlugins/DXFSplineToPolyline.bundle/Contents/", line 216, in exportDxf

newDxfContent = replaceDxf(spline_polyline_map, dxfContent)

File "/Users/devonmccauley/Library/Containers/com.autodesk.mas.fusion360/Data/Library/Application Support/Autodesk/ApplicationPlugins/DXFSplineToPolyline.bundle/Contents/", line 84, in replaceDxf

for eachVertexItem in spline_polyline_map[mapIndex]:

KeyError: 204



Any ideas how I might be able to get it up, and running?  Any help would be much appreciated!



Message 2 of 12

Hi @Vintagetunes ,

My test worked well with some simple samples.

Could you share the design you are working on?

Message 3 of 12



I don't know if it helps, but here's a link to my other post that lead me here



Message 4 of 12
in reply to: Vintagetunes

I didn't figure out the details of the problem, but I found that if I deleted all of the text labels you have on the sketch, that the add-in works.

Brian Ekins
Inventor and Fusion 360 API Expert
Message 5 of 12

You're right @BrianEkins.

I was looking at the source code and I'd found that the texts get converted to splines when they have some curves/arcs, and mixed with the real splines of the design.

I'm working on a workaround for it, which I hope to complete soon. 



Jorge Jaramillo

Message 6 of 12

@Jorge_Jaramillo @BrianEkins   Awesome!  That worked for me too!  Thank y'all so much!  


Any chance that's y'all might know why my dxfs are broken into unconnected segments?   I've been talking to some folks in the forums here, and on reddit, but we haven't been able to find a solution.  My water jet guy is pretty frustrated that I've been sending him broken files 😬

Message 7 of 12

Hi @Vintagetunes ,

Please find attached a new version of the add-in.  Just for testing, you can override the file under:

C:\Users\<USERNAME>\AppData\Roaming\Autodesk\ApplicationPlugins\DXFSplineToPolyline.bundle\Contents (for windows installation) [Please keep a copy of the original one].


It worked for me with some test designs, including the one you shared.


@BrianEkins : what is the best way to request that this improvement is being updated on the fusion's app store?


You can look for #ADDED marks on source code with the changes I made,

In summary: the solution was to convert only splines on DXF file which are really splines on design document.

The bug comes when more splines are stored in the DXF file than the algorithm expect.


Hope this solved the problem detected.


Best regards,

Jorge Jaramillo


Message 8 of 12

@Jorge_Jaramillo  Amazing!   I hope you can forgive my ignorance along these lines, but do I just replace the original file with the one you've attached?  Will this work on Mac?

Message 9 of 12

@Vintagetunes , yes, you can replace it.  It works for both windows and mac.


There is nothing to forgive you.  I's nice to see that I can help others with my knowledge. Hopefully, someone will benefit with yours.


Best regards,

Jorge Jaramillo

Message 10 of 12

It works perfectly!  My dxfs are still broken into separate line segments (I'm not certain why it was suggested to me to fix that. It doesn't seem like that's what this add-in is for). But the glitch is gone!  Thank y'all for all the help!

Message 11 of 12

Hi @Vintagetunes ,

Your DXF is broken into separate line segments because each spline is in a separate definition on that file.


What you can do in illustrator is join them all together with the "Shape Build Tool [Shift-M]":

- select the line segments you'd like to join

- choose "Shape Build Tool"

- then select the profile you want the lines to contain

and that is it.  You will get a compound path that contains the desired shape.


Give it a try and let us know you results.



Jorge Jaramillo

Message 12 of 12

@Vintagetunes  The problem with your water jet guys' software is low end CAD software can not read splines higher that degree 3 but your files have some degree 5 splines. Why he's still having problems with the files after running them through the spline to DXF seems odd.


I've attached another DXF where I joined all the lines into closed polylines, give that a go. If that works you might want to try QCad to join the lines before sending out for cutting.



Mark Hughes
Owner, Hughes Tooling
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


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