Revit .NET Element has quite some methods and properties having something to do with the most important parameter stuffs. Element.GetOrderedParameters() Method vs. Element.Parameters Property are two most important ones, as titled.
Here is the description about the Element.GetOrderedParameters() Method in the help file.
"The collection consists of only visible parameters associated to the element; it returns a different list than Element.Parameters.
The parameters are returned in the order in which they appear in the Revit UI within a given group; however, parameters of different groups may be mixed within this output.
Currently the Revit UI order is determined first by group and next by the order of the individual parameters."
It is kindly true. However, not sure what the order of those returned parameters can help programmers? It is not like those ordered ones in the Family Parameter Manager as we can control the order programmatically or users manually in that UI. Can the order in the Element Properties dialog be changed either by users or by addins?
Here is the description about the Element.Parameters Property in the help file.
"The Parameters property contains a set of all the parameters that the element supports. These parameters are displayed in the Element properties dialog in the Autodesk Revit interface. These parameters can be retrieved and set via the parameter objects stored in this set."
It is kind of false. Some of the returned parameters are not displayed in the Element Properties dialog at all. That is what those by GetOrderedParameters() behave so actually. Can we delete or add some 'parameter objects stored in this set'? They can be retrieved for information access, of course!
In addition, as verified by the Revit API Lookup tool, some of Element.Parameters are duplicates and some are pretty weird! Also wonder why one is Method but the other Property? Was the method supposed to have some argument like order sequence (ascending or descending) at start maybe but had to be dropped out at last?!
So, please forget about the Element.Parameters Property but focus on the Element.GetOrderedParameters() Method?
Any different experience or idea? Please feel free to jump in.
Recent Comments