PDA

View Full Version : Parameters with API?



hatamm
2007-05-30, 07:33 PM
Hi all,

I have a question about using API Parameters command. While testing the sample code "FireRating" in the revit SDK file, I notice that every time the "ApplyParameter" is executed, it create a new parameter name "Fire Rating" to all the doors.

The problem is revit doesn't care if the parameter is there or not, so every time time the command is executed, a new parameter is created. So my question is; is there a way to make revit actually do a test for the existing of the parameter first, and than either create a new one or just update the value. Thanks in advance.

TH

dtownsend
2007-05-30, 10:08 PM
You can access parameter names...



Dim param As Autodesk.Revit.Paramet

param.Definition.Name = "FireRating"



You could check to see if the element has a parameter with the name FireRating and if it does then don't add it again.

hatamm
2007-06-11, 05:17 PM
Thanks a lot Dustin, I will give that a try!