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: 

Parameter I/O Add-in Question

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
joecamisa
280 Views, 3 Replies

Parameter I/O Add-in Question

I am using the Parameter I/O add-in with great success.  This is an excellent add-in!  This add-in has enabled me to create a model with 500 dimensions driven by a single User Parameter.  My question: is there anyway to speed the import process?  Import takes about 25 minutes for a model with 500  dimensions.   Seems like the model is being updated for each parameter imported - is there a way to hold off on Compute until all parameters have been imported?

 

Thanks for any guidance.

 

Joe Camisa

 

 

3 REPLIES 3
Message 2 of 4
kandennti
in reply to: joecamisa

Hi @joecamisa .

 

I haven't used the Parameter I/O Add-in, but if you can modify it, changing the timeline.markerPosition Property might help.

https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-d0cede26-e905-45b4-b30d-8f244670c1f7 

 

 

I drew a circle on the sketch to create a diameter constraint and ran the following script

# Fusion360API Python script
import adsk.core, adsk.fusion, traceback
import time

def run(context):
    ui = None
    try:
        global _app, _ui
        app = adsk.core.Application.get()
        ui = app.userInterface
        des  :adsk.fusion.Design = app.activeProduct

        prm = des.allParameters.itemByName('d1')

        # As it is
        sw = stopwatch()
        sw.start()
        test(prm)
        print(f'As it is:{sw.lap()}')

        # Move MarkerPosition
        sw.start()
        tl = des.timeline
        markerPos = tl.markerPosition
        tl.moveToBeginning()
        test(prm)
        tl.markerPosition = markerPos
        print(f'Move MarkerPosition:{sw.lap()}')

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

def test(prm, count = 500):
    for v in range(count):
        prm.value = v

class stopwatch():
    def __init__(self):
        self.t = 0
    def start(self):
        self.t = time.time()
    def lap(self) -> str:
        return '{:.3f}'.format(time.time() - self.t)

 

Here are the results.

As it is:45.503
Move MarkerPosition:29.732

 

I have a feeling that more complex data would have a bigger effect.

Message 3 of 4
BrianEkins
in reply to: joecamisa

I think you can do what @kandennti suggests without changing any code.  Just move the timeline marker to the beginning of the timeline before you run the Parameter I/O command, run the command, and then move the marker back to where it was.

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

Hello @kandennti and @BrianEkins 

 

Your suggestions have worked!   I found that I needed to move the timeline marker back to just AFTER the sketch with the dimensions to be exported, made proportional in a spreadsheet and reimported as User Parameter based (fx) dimensions.  The import took less than one minute vs 20 minutes without moving the timeline marker.

 

This is a great help for my work process and is GREATLY APPREACIATED. 

 

Thank you both.

 

I hope soon I will learn enough to contribute guidance as you both have.

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