Community
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.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Generate toolpath using Python script in Fusion 360.

4 REPLIES 4
Reply
Message 1 of 5
asherry137
426 Views, 4 Replies

Generate toolpath using Python script in Fusion 360.

I'm trying to generate a toolpath for 3d printing using Python script in Fusion 360. I have successfully imported the STL file and now trying to create a new CAM operation as per this doc New CAM operation, but there is this error saying:

AttributeError: 'NoneType' object has no attribute 'setups'

for line in the code having:

setups = cam.setups

That is because I guess there is no setup for the CAM operation. Hence I referred to this doc to generate the Setup Generate Setup Sheets, but the document says:

# For this sample script to run, the active Fusion document must contain at least one CAM operation.

And therefore, they seem to have a dependency on each other. I would highly appreciate a solution to how this can be solved.
Please refer to the screenshots attached for the code and error message

 

4 REPLIES 4
Message 2 of 5
kandennti
in reply to: asherry137

Hi @asherry137 .

 

We have created a sample that imports an STL file and template and calculates the toolpath.

The API does not provide a way to create a new setup, so we are using a forced method.

This is a difficult area for CAM automation with the current API.

Message 3 of 5
asherry137
in reply to: asherry137

Hello @kandennti,
Thanks for the reply. I'm glad to see the script you shared.
But I'm trying to generate the toolpath for additive manufacturing. For that, the template file has an extension of .machine(it stores the printer and filament info) which on replacement with the .f3dhsm-template template extension in your code, showed an error. Please look at the attached video it shows the process I'm trying to achieve.

Message 4 of 5
kandennti
in reply to: asherry137

@asherry137 .

 

I watched the video and I still think it is difficult with the current API.

Message 5 of 5
asherry137
in reply to: kandennti

Do you think it still can be done?

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

Post to forums  

Technology Administrators