We talked about converting element parameters, family parameters, and project parameters to shared parameters in both C# and VB.NET before. We also addressed how to convert shared parameters to family parameters with VB.NET in the previous post. Now let’s look at other parameter conversion scenarios using VB.NET.
Revit Parameter Organizer can organize various Revit parameters such as Shared Parameters, Family Parameters, Project Parameters and Built-in Parameter in many good ways.
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:
Create Project Parameter with VB.NET
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:
Attach Shared Parameter with VB.NET
SharedParameter Attacher of RevitAddinCoder
Create Project Parameter with VB.NET
ProjectParameter Creator of RevitAddinCoder
Redefine Project Parameter with VB.NET
ProjectParameter Reshaper of RevitAddinCoder
VB.NET 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:
Convert FamilyParameter to Shared Parameter with VB.NET
Create Project Parameter with VB.NET
ProjectParameter Creator of RevitAddinCoder
Redefine Project Parameter with VB.NET
ProjectParameter Reshaper of RevitAddinCoder
VB.NET 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:
Convert FamilyParameter to Shared Parameter with VB.NET
Create Project Parameter with VB.NET
ProjectParameter Creator of RevitAddinCoder
Project Parameter to Element Parameter
This is achieved through parameter BindingMap:
Redefine Project Parameter with VB.NET
ProjectParameter Reshaper of RevitAddinCoder
VB.NET 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:
Convert Project Parameter to Shared Parameter with VB.NET
Convert Shared Parameter to FamilyParameter with VB.NET
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 for both C# and VB.NET.
Recent Comments