knowing the names of parameters

knowing the names of parameters

anthony.a.douglas
Enthusiast Enthusiast
784 Views
2 Replies
Message 1 of 3

knowing the names of parameters

anthony.a.douglas
Enthusiast
Enthusiast

Hey there, I am still trying to understand the more fundamental nature of the object model and how things are programmed here, but I am running into some issues.

 

First of all, in the example here, for instance :https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-2716A113-555D-41B0-8FC4-4FCD265434C4 a parameter of a toolpath is modified.  The issue I have is how I would know what the name of the parameter was.  I cannot see where in the reference manual these parameters are listed.  There would be a great many, but they still all need to be documented, or how can we know what they are, their implications and names.

This problem occurs in other cases, such as https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-2716A113-555D-41B0-8FC4-4FCD265434C4 the parameter with the name "job_programName" - how could I have known that the parameter I wanted had that name?

A

 

 

0 Likes
Accepted solutions (1)
785 Views
2 Replies
Replies (2)
Message 2 of 3

kandennti
Mentor
Mentor

Hi @anthony.a.douglas .

 

This way you can dump all the parameters.

#Fusion360API Python script
import adsk.core, adsk.cam, traceback

def run(context):
    ui = None
    try:
        app = adsk.core.Application.get()
        doc = app.activeDocument
        products = doc.products
        
        # Get the CAM product
        cam = adsk.cam.CAM.cast(products.itemByProductType("CAMProductType"))

        # List of all setups
        setups = cam.setups
        
        # dump setup.parameters
        setup = setups[0]
        for prm in setup.parameters:
            print('{} : {}'.format(prm.name, prm.expression))

    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))

 

However, no method for obtaining the correct value has been found.

https://forums.autodesk.com/t5/fusion-360-api-and-scripts/how-to-get-the-final-value-of-camparameter... 

0 Likes
Message 3 of 3

kandennti
Mentor
Mentor
Accepted solution

There was another way.
If you hold down the Shift key in the GUI and display the tooltip, you will see the parameter names.

 

1.png

0 Likes