Message 1 of 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am not sure what I am doing wrong but I cannot seem to export Templates from operations for fusion using the API.
Here is the script I am trying:
import adsk.core, adsk.fusion, adsk.cam
def save_template():
# Get the application
app = adsk.core.Application.get()
# Get the active document
doc = app.activeDocument
# From the Products collection on the active document, get the CAM Product
cam :adsk.cam.CAM = doc.products.itemByProductType('CAMProductType')
# Get the first setup.
setup = cam.setups.item(0)
# Get the first operation.
operation = setup.operations.item(0)
# generate the Cam Template
returnValue = adsk.cam.CAMTemplate.createFromOperations(operation)
# Save the template to a file
returnValue.save('C:\\file.camtemplate') # Change this to your desired file path
# Call the function
save_template()
I am trying to use the CAMTemplate Object to generate templates.
I was also trying to give it a operation list but then Fusion just fully cashed with no error.
Solved! Go to Solution.