I repeatedly hear from developers who wish to define a specific enumerated set of parameter values for their add-ins and limit the selection to these values in the element property palette user interface.
Internally, Revit does implement a system to handle this, for instance by using negative element ids for element property drop-down list enumerations.
This has also been a long-standing wish list item, and unfortunately still remains in that state, currently incorporated in the issue CF-3498 API wish: drop-down enumeration parameters for combo box.
I would not bore you with this, except that Marcelo Quevedo of hsbcad recently brought it up again and also kindly provided suggestions for two workarounds:
In Marcelo's own words:
We need to create drop-down parameters for our families such as Enums in C#. For instance, a set of enumerated values such as this:
Parameter 1: Orientation
with following drop-down values:
Parameter 2: Shape
:
We found two workarounds, but they aren’t perfect.
For the first workaround, we created nested Generic Model families for each drop-down (one nested family for orientation, and other for Shape). We created types for these families named according to the desired drop-down values. In addition, we added two 'Generic Model Family Type' parameters: one to link the Orientation nested family, and one for the Shape nested family. However, the issue is that the 'Generic Model Family Type' parameter links the Category and displays all nested Generic Model family types as available options.
It would be better if the family type parameter would link one single family instead of the entire category.
Here is a screen snapshot of the result:
For the second workaround, we created Integer parameters and defined a tooltip to explain what each integer value represents.
For example, for Orientation
, we created an integer parameter called Orientation
and specified the following tooltip:
The result looks like this:
I hope this helps.
Many thanks to Marcelo for sharing these two creative workarounds!
Proposed by Matt Taylor in his comment below:
I've just come up with another way of doing this.
It's more of a model template solution than a family solution.
Place a family instance with each value in a design option, then just make sure that design option is omitted from all views and schedules.
Because all values for those parameters exist somewhere in the model, they still appear on the pull-down list.
Many thanks to Matt for this nice idea!