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: 

Issues on design.modifyParameters method

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
en9y37
221 Views, 5 Replies

Issues on design.modifyParameters method

Hi all.

 

Recently I'm dealing with the design.modifyParameters method, which is intended to modify several parameters at once more efficiently.

 

Everything works fine as long as I use it to modify model parameters, but nothing happens if I try to modify user parameters, even the method returns True although there's no a change at all.

 

Is there any know issue or bug about this? Here I leave a f3d and the code to reproduce this bug.

 

 

import adsk.core, adsk.fusion, adsk.cam, traceback

def run(context):
    ui = None
    try:
        app = adsk.core.Application.get()
        ui = app.userInterface
        product = app.activeProduct
        design = adsk.fusion.Design.cast(product)
        
        para1 = design.allParameters.itemByName('para1')
        para2 = design.allParameters.itemByName('para2')
        parameterList = [para1, para2]   
        
        value1 = adsk.core.ValueInput.createByReal(20)
        value2 = adsk.core.ValueInput.createByReal(20)
        valueList = [value1, value2]
        
        result = design.modifyParameters(parameterList, valueList)
        
    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))

 

Thanks in advance to all. 

5 REPLIES 5
Message 2 of 6
BrianEkins
in reply to: en9y37

I can reproduce the problem and will make sure a bug gets files. I wonder if this is a new problem or if it's always behaved like this.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Message 3 of 6
en9y37
in reply to: BrianEkins

Thanks @BrianEkins for your response and for confirming this is a bug 

 

I've never been able to make this method to work properly. I used to think that it was due to some mistake of mine. So perhaps you're right and this method always has behaved like this.

Message 4 of 6
en9y37
in reply to: en9y37

More issues about this.

 

I've just noticed that if the values list is generated trough the adsk.core.ValueInput.creatreByString() method, the expression is not modified (so far, just tested in model parameters, in user parameters not working yet). Instead of that, just the value is modified following the equation of the expression.

 

By the way, any new about a fix for this bug?

Message 5 of 6
john.kirchner
in reply to: en9y37

Hello - it looks like there was a fix for this bug that will be included in the next release towards the end of the month I believe. The behavior you described with using ValueInput.createByString() was noticed so that should be accounted for as well.



Message 6 of 6
en9y37
in reply to: john.kirchner

Thanks @john.kirchner !!

 

Just tested the fix in the insider pre-release and works great.

 

Thanks all Autodesk team!!!

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report