Message 1 of 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am Turumella Anil Yasasvi. I am studying master studies and currently working on a project using Fusion 360, The main objective is to trigger the parametertic model through python code.
But I am facing the issues while handling it, could you please help me out with the following issues:
- The code I have programmed is:
import os
import adsk.core, adsk.fusion, traceback
# Create an instance of the Fusion 360 application
app = adsk.core.Application.get()
if not app:
app = adsk.core.Application.create()
# Get the user interface of the application
ui = app.userInterface
# Define the file path of the Fusion 360 CAD model to open (*** REPLACE THE file_path WITH CORRESPONDING FILE PATH ON YOUR COMPUTER)
file_path = 'C:/Users/Anil Yasasvi/Desktop/Parameteric_Model_1 v1.f3d'
# Open the Fusion 360 CAD model
doc = app.documents.open(file_path, True)
# Get the root component of the active design
design = adsk.fusion.Design.cast(doc)
print(design)
os.system("pause")
root_comp = design.rootComponent
# Get the parameters collection of the root component
params = root_comp.modelParameters
print(params.item(1))
os.system("pause")
# Loop through each parameter and print its name and value
for param in params:
param_name = param.name
param_value = param.value
print(param_name + ": " + str(param_value))
# Close the CAD model and quit Fusion 360
doc.close(False)
app.quit()
- Here in the params it is only taking the model parameters which are unsaved while opening the model outside the Fusion 360(i.e; when it was exported as .f3d file)
- Is there any other option to change the code to take the values from user parameters other than from modelparameters
- Also the error I observed while running this add-in was
TypeError: Wrong number or type of arguments for overloaded function 'Documents_open'.
I am also attaching the parameters window for your reference, kindly help me regarding this issue.
With Regards
Turumella Anil Yasasvi
Solved! Go to Solution.