Announcements
Autodesk Community will be read-only between April 26 and April 27 as we complete essential maintenance. We will remove this banner once completed. Thanks for your understanding

Trouble with spline to polyline add-in.

Vintagetunes
Advocate Advocate
861 Views
11 Replies
Message 1 of 12

Trouble with spline to polyline add-in.

Vintagetunes
Advocate
Advocate

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:

 

Failed:

Traceback (most recent call last):

File "/Users/devonmccauley/Library/Containers/com.autodesk.mas.fusion360/Data/Library/Application Support/Autodesk/ApplicationPlugins/DXFSplineToPolyline.bundle/Contents/DXFSplineToPolyline.py", 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/DXFSplineToPolyline.py", 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!

 

Thanks!

0 Likes
Accepted solutions (1)
862 Views
11 Replies
Replies (11)
Message 2 of 12

Jorge_Jaramillo
Collaborator
Collaborator

Hi @Vintagetunes ,

My test worked well with some simple samples.

Could you share the design you are working on?

0 Likes
Message 3 of 12

Vintagetunes
Advocate
Advocate

Sure!  

 

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

 

.https://forums.autodesk.com/t5/fusion-360-design-validate/dxf-exporting-broken-contours-any-good-way...

0 Likes
Message 4 of 12

BrianEkins
Mentor
Mentor

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
Website/Blog: https://EkinsSolutions.com
1 Like
Message 5 of 12

Jorge_Jaramillo
Collaborator
Collaborator

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. 

 

Regards,

Jorge Jaramillo

1 Like
Message 6 of 12

Vintagetunes
Advocate
Advocate

@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 😬

0 Likes
Message 7 of 12

Jorge_Jaramillo
Collaborator
Collaborator
Accepted solution

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

 

3 Likes
Message 8 of 12

Vintagetunes
Advocate
Advocate

@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?

0 Likes
Message 9 of 12

Jorge_Jaramillo
Collaborator
Collaborator

@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

0 Likes
Message 10 of 12

Vintagetunes
Advocate
Advocate

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!

0 Likes
Message 11 of 12

Jorge_Jaramillo
Collaborator
Collaborator

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.

 

Regards,

Jorge Jaramillo

1 Like
Message 12 of 12

HughesTooling
Consultant
Consultant

@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

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.

EESignature


1 Like