Please help fix Parameter I/O AddIn. Not updating parameters.

Please help fix Parameter I/O AddIn. Not updating parameters.

olegkar
Participant Participant
1,220 Views
6 Replies
Message 1 of 7

Please help fix Parameter I/O AddIn. Not updating parameters.

olegkar
Participant
Participant

Recent Fusion 360 update changed something and now AddIn does not work correctly.

It reads parameters from file, writes them to file. But It can not update them if they already exist.

 

I guess the problem is in those lines:

 

def readParametersFromFile(filePath😞
    app = adsk.core.Application.get()
    design = app.activeProduct
    ui  = app.userInterface
    try:
        paramsList = []
        for oParam in design.allParameters:
            paramsList.append(oParam.name) 
 
paramsList should get the names of all parameters in the current model, but it appears to be empty.
I guess in the October update this design.allParameters has been changed. And the question is how to get the names of parameters now?
 
Please help! My project relies on this AddIn a lot
 
1,221 Views
6 Replies
Replies (6)
Message 2 of 7

tim.grant87XF7
Participant
Participant

Yes, I also have this problem since yesterday's update. I don't have the skills to sort this one...

 

Can we please have a grown up to help?

0 Likes
Message 3 of 7

BrianEkins
Mentor
Mentor

Nothing specific to parameters has changed but there's a tool that's used to build the API that was updated to a newer version and I suspect this is a result of that. There's a problem with the original add-in that must have been there since the beginning but it wasn't being caught.  It was trying to set the value of a read-only property.  Now that's causing a failure, which it should have been doing all along.

 

I'll see if I can track down who's now responsible for this add-in and get the version on the App Store updated.  In the meantime you can edit the version you installed from the store.  To fix it, comment or delete line 220 in ParameterIO.py.

 

 

paramInModel.unit = unitOfParam

 

 

It's not possible to change the unit type of an existing parameter and that's what that line is attempting to do. 

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Message 4 of 7

tim.grant87XF7
Participant
Participant

Thanks BrianEkins - commenting out line 220 in ParameterIO.py has solved this problem for me

 

Good work!

Message 5 of 7

goyals
Autodesk
Autodesk

Parameter I/O add-in is updated on App Store with fix. Please try after updating to new version. Thanks.



Shyam Goyal
Sr. Software Dev. Manager
Message 6 of 7

tim.grant87XF7
Participant
Participant

The official app store version is now installed and it also works great. Thanks

0 Likes
Message 7 of 7

pludikar
Collaborator
Collaborator

Just a note and a word of warning.  I'm reasonably sure this hasn't been fixed.  

 

If you have parameters that refer to other parameters (eg innerWidth = width - 2*wallThickness), importing the parameter file will fail IF the referred to parameters occur AFTER the parameter that references them

innerWidth = width - 2*wallThickness
width = 24
wallThickness = .75  #this order will fail!

 

the fix for this is to use an editor to swap the order to ensure consistency:

width = 24
wallThickness = .75
innerWidth = width - 2*wallThickness  #this order will work

  I hope that helps someone.

 

I'm not an expert, but I know enough to be very, very dangerous.

Life long R&D Engineer (retired after 30+ years in Military Communications, Aerospace Robotics and Transport Automation).
0 Likes