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

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

Anonymous
Not applicable
436 Views
1 Reply
Message 1 of 2

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

Anonymous
Not applicable

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)
437 Views
1 Reply
Reply (1)
Message 2 of 2

Justin.Krutz
Explorer
Explorer

I experienced this too. Thanks for finding a workaround!

0 Likes