Crash report: allParameters.count in sample files

Crash report: allParameters.count in sample files

PinRudolf
Advocate Advocate
981 Views
6 Replies
Message 1 of 7

Crash report: allParameters.count in sample files

PinRudolf
Advocate
Advocate

To find all parameters used in my design I use design.allParameters.count and iterate over the different parameters. In all new designs this work great, but on de sample files this will initiate a crash of Fusion 360.

 

I think it has to do with the time the design has been created, but I cannot confirm this with other designs.
When looking into the sample file Lamp I noticed that Sweep2 only gives me 1 parameter. I'm using the parameter menu to check this. When I edit Sweep2 and then close it again another 2 parameters get created; the taper angle and the twist angle. After adding these parameters the code will no longer crash Fusion.

 

The following code will crash Fusion when running it as a script on the sample files:

import adsk.core

def run(context):
    app = adsk.core.Application.get()
    design = app.activeProduct
    paramCount = design.allParameters.count

Sure, now you'll think "Stop running that script on the sample files then!". Which is a fair advise, but here's my problem:
I'm trying to get an add-in published to the app store. The team at Autodesk that handles the applications for publishing test all add-ins using the samples files of Fusion 360. Obviously my add-in will not apply for approval as long as it can make Fusion 360 crash. (Which is a 100% of the time when you test it on the sample files)


There might be workarounds. I might be able to invoke a recalculation of the parameters by editing features of which I have tested that they are not conform the new parameters standards. However this will not prevent Fusion to  crash on other 'old' design files.

0 Likes
Accepted solutions (1)
982 Views
6 Replies
Replies (6)
Message 2 of 7

goyals
Autodesk
Autodesk

I tried but not able to notice crash with Lamp design by running the script you shared. We will investigate it further. Thanks for posting it.



Shyam Goyal
Sr. Software Dev. Manager
0 Likes
Message 3 of 7

PinRudolf
Advocate
Advocate

Hi Goyals,

 

Thanks for your reply!

 

Could it be that every user has a different version of the lamp design depending on the moment their account has been created? I still experience the issue with the exact same script.

 

Just in case I have attached an exported version of the lamp-design that is on my account.

 

Also, I am running on Windows. Currently on fusion version 2.0.6670.

I've just resend the latest log file after testing the script. Please let me know if you need the log-file separately.

0 Likes
Message 4 of 7

JeromeBriot
Mentor
Mentor

Hello,

 

I confirm that Fusion 360 crashes on Windows and Mac (2.0.6670).

 

0 Likes
Message 5 of 7

kandennti
Mentor
Mentor

I will crash too.
Created a script that displays the number of model parameters for each component.

import adsk.core, adsk.fusion, traceback

def run(context):
    ui = None
    try:
        app = adsk.core.Application.get()
        ui  = app.userInterface
        des = app.activeProduct

        lst = ['** Component Name / ModelParameters Count **']
        for cmp in des.allComponents:
            lst.append('{}/{}'.format(cmp.name, cmp.modelParameters.count))

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

1.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Although the root component is displayed as 33, it is actually 31 when counted.

 

Also, I didn't understand the meaning of “Diameter Dimension-2” which does not belong to any component.

 

2.png

 

 

 

 

 

 

 

 

 

 

 

Message 6 of 7

Nilesh.Mohite
Autodesk
Autodesk
Accepted solution

Hi @PinRudolf 

I have tried using your lamp design. I also noticed crash while running the script with that design.

I digged deeper in the code, while exploring I noticed, as you have mentioned, twist angle and taper angle are added in newer version of Sweep features i.e 4th version. As for the older files those were not there.Those are not initialized while opening this old design.

So when we are quering all parameters for sweep feature we are pushing these two parameters without validation (assuming those paramters are present). Hence while acessing parameters list of  sweep feature for older file its crashing fusion.

We will log this issue. And will provide with proper solution.

Thanks for reporting the same.

 

 

 

 


Nilesh Mohite
LinkedIn

If my answer helped you, please use  ACCEPT SOLUTION .
Also be generous with Likes!  Thank you and enjoy!

Message 7 of 7

PinRudolf
Advocate
Advocate

Thanks everyone for looking into this! I realise it is not an important issue (for most), which makes me appreciate the effort you put into this even more!

 

Thanks kandennti for supplying an alternative!