Monday, April 27, 2009

Revit 2010: Parameter.Set – Unexpected Behaviour – Fixed in 2010

I previously wrote a blog post about unexpected behaviour from the Parameter.Set method in the Revit API.

What was happening was if you called Parameter.Set and set a value that was the same as the previous value (ie unchanged) it would return false. This caused problems with detecting when the operation failed (it didn’t fail, it did what we asked).

A note in the Revit Platform API Changes and Additions document confirms that this has been fixed in Revit 2010, and the more logical functionality has been introduced:

Parameter.Set return value when value is unchanged

Previously, Revit returned False if the input value for Parameter.Set was the same as the current value. Revit now returns True in this case.”

No comments: