We talked about converting element parameters, family parameters, and project parameters to shared parameters before. We also addressed how to convert shared parameters to family parameters in the previous post. Now let’s look at other parameter conversion scenarios.
Shared Parameter to Project Parameter
This is actually the only way to create new Project Parameter instances programmatically. We have addressed it in some earlier articles:
Parameter of Revit API - Create Project Parameter
ProjectParameter Creator of RevitAddinCoder
Shared Parameter to Element Parameter
Shared Parameter cannot be converted to Element Parameter directly. It needs an inter media, the Project Parameter, to help to achieve that goal. That is, a Project Parameter needs to be created from a Shared Parameter first and then one or multiple element categories to be associated with the Project Parameter. Doing so will make the (Shared) Project Parameter appear in the Parameters collection of the associated Element through the parameter map (category) binding.
Here are some posts addressing these matters:
Parameter of Revit API - Attach Shared Parameter
SharedParameter Attacher of RevitAddinCoder
Parameter of Revit API - Create Project Parameter
ProjectParameter Creator of RevitAddinCoder
Parameter of Revit API - Redefine Project Parameter
ProjectParameter Reshaper of RevitAddinCoder
Parameter of Revit API - Extensions To BindingMap
ProjectParameter BindingMap Extensioner
Family Parameter to Element Parameter
They cannot be converted to each other directly. In fact, most of them should be internally defined from built-in parameters. In terms of conversion between shared family parameters and shared element parameters (or more accurately project parameters) it is apparent that shared parameters can serve as the inter media for this purpose. That is, we can create a shared parameter from the shared family parameter and then convert the shared parameter to a project parameter which is associated with the element through category bindings, vise visa.
Here are some posts talking about some related matters:
Parameter of Revit API - Convert FamilyParameter to Shared Parameter
Parameter of Revit API - Create Project Parameter
ProjectParameter Creator of RevitAddinCoder
Parameter of Revit API - Redefine Project Parameter
ProjectParameter Reshaper of RevitAddinCoder
Parameter of Revit API - Extensions To BindingMap
ProjectParameter BindingMap Extensioner
Family Parameter to Project Parameter
This can be achieved by converting the family parameter to a shared parameter first and converting the shared parameter to the project parameter of interest:
Parameter of Revit API - Convert FamilyParameter to Shared Parameter
Parameter of Revit API - Create Project Parameter
ProjectParameter Creator of RevitAddinCoder
Project Parameter to Element Parameter
This is achieved through parameter BindingMap:
Parameter of Revit API - Redefine Project Parameter
ProjectParameter Reshaper of RevitAddinCoder
Parameter of Revit API - Extensions To BindingMap
ProjectParameter BindingMap Extensioner
Project Parameter to Family Parameter
This can be achieved by converting the Project parameter to a shared parameter first and converting the shared parameter to the Family parameter:
Parameter of Revit API - Convert Project Parameter to Shared Parameter
Parameter of Revit API - Convert Shared Parameter to FamilyParameter
In terms of details of the various coders referenced in this post please refer to the linked posts for ideas and code examples.
RevitAddinWizard covers these all either directly or indirectly with its various parameter coders.
Recent Comments