Message 1 of 2
DistanceValueCommandInput's "expression" doesn't update after arrow dragging

Not applicable
02-23-2020
11:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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)