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
Solved! Go to Solution.
Solved by BrianEkins. Go to Solution.
Solved by kandennti. Go to Solution.
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.
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.
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.