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: 

Idea : generating toolpath from DXF layer depending on their name

Message 1 of 10
982 Views, 9 Replies

Idea : generating toolpath from DXF layer depending on their name

Hi everyone, 

first i'm not a API guy, just a woodworker who would like to improve his work and efficiency. I don't have the skill to do that and I don't have the time to learn ...


I'm wondering since a long time if it would be possible for a script or an add-in to automatically create a toolpath (from a template previously made) from layers of a DXF ? DXF layers would be named specifically so the script could recognize it and apply the corresponding template.


It's like what Vectric's software are able to do ... so I'm wondering if it could be used in fusion.

Possibilities could be really interesting with this kind of stuff.


Does someone is interested in this and is able to do it ?



Message 2 of 10

Hi - Not sure this is going to be much help, but thought I'd add my thoughts as there have been no responses to your question yet...


I'm not yet used the CAM API's in Fusion, but my research indicates they are not very complete.  They generally lack the ability to create toolpaths, and much more.  However as of the September 2020 update, they added some capabilities to create operations from templates (see What's New September 2020 - API and CAMFolder.createFromTemplate) which is a step in the right direction.  Perhaps someone with more knowledge of the CAM api's can interject if it's current possible to go from a sketch/model to a working CAM setup? 


The CAM side is really the question, as the DXF side of this is much easier.  After the user imports the DXF, with each layer as a separate sketch, the logic would simply be to walk all sketches in the model and use the appropriate template for the CAM for each sketch.  If it's a single template, then this is a small fragment of code.  If a user interface is needed, such as to select a template for each sketch, then it gets more complex.


However - hopefully somebody can chime in on the CAM side of the API, as that may be a barrier to getting your idea to work at all.


Message 3 of 10

Looks like the CAM API improvements may allow this ... again, I've not worked on this API area (yet), but for reference I found this sample which could be helpful:  Sample CAM API usage 



Message 4 of 10

Yes, it's after reading the changes of the septembre update that I tought, maybe now it will be possible. I'm still not aware if API is able to select a geometry by itself, but as the toolpath should be add to the entire layer of the DXF maybe there is a trick to make it possible. I understand that API cannot recognize a contour from a drill or a external contour from inner contour ... that's why for me DXF layers is the key of the problem.


Is someone interested with this idea ? 

Message 5 of 10

@prainsberry  any interest in the idea ? 

Message 6 of 10

Since I'm interested in learning more about the CAM APIs, I spent some time diving a bit deeper.  I also don't see a way to select geometry on an operation.  It seems that the benefits of an add-in as you suggest, given the limitations of the API, may be limited, as the user flow might be something like:


- User manually imports DXF with one layer per sketch

- Add-in pulls in template(s), one per sketch

- User then manually goes to each operation and adds geometry

- Add-in can then do the post


This isn't much value-add.  Unless I'm missing how to set up geometry?  I'll go spend some time in the debugger looking at the objects and see if there is something going on that I'm missing.  Or perhaps somebody with more CAM API experience can chime in!

Message 7 of 10

I've been unable to inspect the CAM object to see what it can do - Fusion keeps crashing when I try.   Sounds like Fusion has a bad bug with inspecting some objects.  My post, and another with a similar failure, are here: Fusion crashes when inspecting the CAM object 

Message 8 of 10

first I would like to thank you about all the research and the time you are spending on this ! I really appreciate.


You are right when you say that, if fusion is unable to add a toolpath to a geometry, then this plugin/script is pretty useless. 


As I said earlier, I don't understand anything about API things ... I just thought that using DXF layers would maybe do the trick. In this case, is there actually a way to say to fusion "apply the toolpath to all the geometries of the sketch" ? 

It's maybe something that could be easily  implemented. I understand that add geometry recognition to apply a toolpath for a specific geometry in a sketch is pretty hard but in our case we just want to apply a toolpath to all the geometries of a sketch which is more easier in my opinion.


How could it be possible to make this idea be implemented in fusion ? make a post somewhere ? but where ?


Message 9 of 10

Hey sorry just getting to this.  So you are correct that the latest enhancements to the CAM API allow you. to create toolpaths from Templates.  Right now this is most useful for the 3D strategies where specific selections are not as important.  Another addition this past release was the ability to modify all the parameters in an operation.  The next big task for the team is going to be modifying the selections for an operation through the API, which you would to do this as far as I can tell.  It is work in progress, but with all the other priorities I don't have a specific timeline for it yet.  Thanks for sharing this use case as it is another perfect example of why we need to get this done.

Patrick Rainsberry
Developer Advocate, Fusion 360
Message 10 of 10

Thank you for your reply !

Hope you will be able to add this feature as soon as possible ... I believe that you can easily implement a way to apply a toolpaths from a template to all the geometries of a sketch (in this case a dxf layer).

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

Post to forums  

Technology Administrators

Autodesk Design & Make Report