Skip to content

Handling of Parameters

Pawel Baran edited this page Jun 26, 2020 · 13 revisions

General concept

Efficient handling of Revit parameters is one of the key features of Revit_Toolkit. It is possible thanks to RevitParameter BHoM wrappers that are being generated per each parameter of an element (and its type) on Pull and unwrapped on Push. RevitParameters are stored in dedicated fragments that are attached to the BHoM object correspondent with the Revit element. For full control over what is pulled vs what is pushed, separate fragments for Pull (RevitPulledParameters) and Push (RevitParametersToPush) are used.

More details can be found in the next paragraphs, examples are available here.

Pulling Revit elements with parameters

As mentioned above, on Pull, the parameters of a Revit element get wrapped into RevitParameter objects, which are collected in RevitPulledParameters fragment attached to the BHoM object representing the element. Such parameters can be queried in two ways:

  • all in one go using GetRevitParameters method
  • value of a particular one using GetRevitParameterValue method

Pushing Revit elements with parameters

Out of the box, default parameter values will be assigned when creating a Revit element based on a BHoM object. This can be overwritten by setting the parameters to push (stored in RevitParametersToPush, as described in the first paragraph) with SetRevitParameter method. Similarly, when an existing element is updated on Push, only the parameters explicitly instructed to be overwritten (SetRevitParameter method) will change.

By default, when a Revit element gets updated, first its parameters are overwritten and then the location is updated. This means that if the user sets values to location-related parameters, the change may not take place due to being superseded by location update. To avoid that, it is possible to prevent the element's location from being updated by switching SetLocationOnUpdate property of RevitPushConfig to false .

Parameter mapping

Clone this wiki locally