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: 

DistanceValueCommandInput's "expression" doesn't update after arrow dragging

1 REPLY 1
Reply
Message 1 of 2
autodeskgato
216 Views, 1 Reply

DistanceValueCommandInput's "expression" doesn't update after arrow dragging

I found a bug today in Fusion 360's API, while trying to read the expression property of a DistanceValueCommandInput. If you drag its blue arrow instead of setting a value in the text box, then the "expression" property is the one from immediately before it was dragged to its new position. The "value" property returns the correct result in centimeters, so it's easy to work around, just posting in case anyone runs into the same issue.

Example:

# Not working ( last value is used )
distance = adsk.core.ValueInput.createByReal(unitsMgr.evaluateExpression(input.expression, "cm"))
# Works
distance = adsk.core.ValueInput.createByReal(input.value)
1 REPLY 1
Message 2 of 2
Justin.Krutz
in reply to: autodeskgato

I experienced this too. Thanks for finding a workaround!

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