Skip to content
Pawel Baran edited this page Apr 15, 2020 · 14 revisions

Notes

  • It is worth having a look at Using the BHoM section and the rest of Revit_Toolkit Wiki before reading this page.
  • All scripts are presented in both Grasshopper and Dynamo. All source files are available in samples.
  • It is highly recommended to switch to Manual mode when working with Dynamo and BHoM.

Pushing elements

As mentioned in Push to Revit basics section, Revit element types are name matched BHoM object properties. Therefore, the only property that is relevant for Construction of BHoM walls and floors as well as Property of BHoM framing elements is their name - all others will be simply ignored on Push.

The scripts below show how to push a primitive building to Revit. To make that happen, family types with names used in the script need to be loaded to the model. PushType is set to CreateOnly, which means that the attempt to update the existing elements will not be made.

Push elements in Grasshopper


Push elements in Dynamo

ModelInstances and DraftingInstances

ModelInstances can be used to push objects of types that are not natively supported by BHoM. A sample below shows how to apply this technique to mechanical ducts.

Push model instances in Grasshopper


Push model instances in Dynamo

Similar approach can be used to drafting instances: the next script generates a line load representation of family Linear Loads and type Load Label 2mm in view named Load Plan Level 0.

Push detail items in Grasshopper


Push detail items in Dynamo

If only the name is specified on definition of a model instance or drafting instance, it will be converted into a primitive (model line, detail line, filled region etc.):

Push detail lines in Grasshopper


Push detail lines in Dynamo

Update

Note: Update is currently in prototype stage and might not always work as expected.

Once the element is pulled from Revit, one can e.g. change one of its parameters (by using SetProperty) and push back to Revit, as shown in the example below. To update the elements instead of creating new, PushType needs to be set either to UpdateOnly or DeleteThenCreate.

Worth noting is the fact that error in Grasshopper component is caused by the empty input - once the pull is executed successfully, it will turn standard gray. Similarily, the warning on Push does not always need to mean that the push had not succeeded - it might happen that e.g. the update of location had not worked, but it was not meant to happen actually.

Update parameter in Grasshopper


Update parameter in Dynamo

Not only elements can be manipulated. Update can be successfully applied to families or types as well, for example to batch rename or changing any other settings. It is worth noting that if the name parameter is left blank on family pull, all families in the model are being pulled in one go.

Update family names in Grasshopper


Update family names in Dynamo

Clone this wiki locally