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: 

Fusion Crash w/o error reporting - progress dialog?

3 REPLIES 3
Reply
Message 1 of 4
imajar
205 Views, 3 Replies

Fusion Crash w/o error reporting - progress dialog?

Hello,

 

Using the sample code below, I am crashing fusion at iteration 349 - no error reporing, no traceback, fusion just disappears.  Does anyone else see this?  My system is Win 10, core i7-6700K, Nvidia M4000, 64 GB Ram.

 

(This sample code is part of a larger code that is processing thousands files, that code was reliably crashing every 349 iterations and I boiled it down to this little tidbit).

 

import adsk.core, adsk.fusion, traceback

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

        progressdialog=ui.createProgressDialog()
        progressmessage="CleaningFiles . . . %v of %m, %p% Complete"
        progressdialog.show("Progress Dialog Complete", progressmessage,0,500)
        adsk.doEvents()
    
        for k in range(0,500):
            # progressdialog.progressValue=k
            newDoc=documents.add(adsk.core.DocumentTypes.FusionDesignDocumentType)
            newDoc.close(False)
            print("Iteration {}".format(k))
        progressdialog.hide()

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

 

Thanks in advance,

 


Aaron Jarrett, PE
Inventor 2019 | i7-6700K 64GB NVidia M4000
LinkedIn

Life is Good.
3 REPLIES 3
Message 2 of 4
xapo9966
in reply to: imajar

Hello,

I've tried your code and got 413 iterations on my i7-8700 CPU with only 16GB RAM. Memory consumption was growing during the code execution. It reached cca 70% just before the crash. I can only guess there are some memory limitations either in python or C++ api.  I would suggest to try the same code in C++.

 

chris 

Message 3 of 4
imajar
in reply to: xapo9966

I'll have to give that a try.

 

Something interesting I could have mentioned in the first post is that If I comment out the progress dialog, that script will finish the 500 iterations.

 


Aaron Jarrett, PE
Inventor 2019 | i7-6700K 64GB NVidia M4000
LinkedIn

Life is Good.
Message 4 of 4
goyals
in reply to: imajar

Thank you for reporting it. We will take a look at it.



Shyam Goyal
Sr. Software Dev. Manager

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