Monday, February 23, 2009

Parameter.Set - Unexpected Behaviour

This is something I ran into today working on a Revit API External Command. The program I was trying to make, involves changing the 'Mark' parameter on beams/columns. I was using the Parameter.Set(string) boolean, which returns true if the parameter was set successfully to the new value, otherwise false. I decided to use the T/F value to determine if it had been successful or not, before incrementing a certain value. It turns out however, that the Set method only returns True if it has been set to a new value. So if you assign the same value that was already in the mark, it returns false! So my program was thinking that the method had failed, when really, it just had set the same value as was already there. So keep in mind that if you are going to use the T/F value of this method, make sure you also compare the value which you are setting, with the current value of the parameter.

Friday, February 20, 2009

Revit 2010

It seems the NDA has lifted on Revit 2010, and the blogosphere is starting to populate with information. I plan on doing a couple of blog posts on the subject, as some of the new API enhancements are great (Families!), but just have to find the time to write the posts.
In the mean time, Matt Mason is doing an epic series on the topic at his blog:
CAD Application Development Be sure to check it out, so far it's been very informative and well done, and he's got a lot more lined up!