When working with Revit or Revit API, we are by and large dealing with Revit Types and Custom Families. This guide takes yous through the diverse Grasshopper components that assist y'all query and create types and families. Information technology is one of the nigh important aspects of the modeling procedure that is more about the Data being modeled, rather than geometry:

Querying Types

You can use the combination of a category picker components eastward.g. Model Categories Picker , the Category Filter component, and Query Types + v1.0 component to collect types in a certain Revit category:

The Query Types + v1.0 component tin further filter the list of types:

Querying Type Info

Employ the ElementType.Identity to access information about that type. Please notation that the Family Name parameter, returns the Organisation Family name for System Types and the Custom Family unit name for Custom Types:

Accessing Family of a Type

When querying the custom types that exist in a Revit model, nosotros can find out the custom family unit definition that contains the logic for each of these types. We are using a custom Grasshopper Python component (Blazon Family) to take hold of the family unit of each blazon existence passed into this component. You can download this component, as a Grasshopper user object, from the link below.

Type Family
Identify under Grasshopper User Objects folder. Notice in Revit > Custom panel

Detect that Duct Systems for example, is a system blazon and therefore have no associated custom family unit definition. Therefore the Type Family component is returning zilch.

Choosing A Specific Type

Rhino.Inside.Revit includes a few components that can assist you option a specific element type from a Revit category:

  • Model Categories Picker : Allows selecting a specific model category e.g. Walls
  • Belittling.CategoriesPicker: Allows selecting a specific analytical category e.g. Analytical Walls
  • Annotation.CategoriesPicker: Allows selecting a specific annotation category e.1000. Dimensions
    • Tag.CategoriesPicker: Allows selecting a specific tag category east.thousand. Room Tags

Y'all can pass the whatsoever of the categories to a higher place to the Element Type Picker component to select a specific blazon from that category:

Determining Default Types

When a build tool is launched (eastward.g. Identify Door), Revit will automatically select the last-used type for that specific category (due east.thou. Doors for Place Door tool). This is called the Default Blazon for that category. This information is helpful when creating elements using the API. Use the component shared beneath to inspect the default types for the provided category:

In example of custom types, the component will render the default DB.FamilySymbol:

Get Default Blazon
Place under Grasshopper User Objects folder. Find in Revit > Custom panel

Modifying Types

Once you have filtered out the desired type, you can query its parameters and apply new values. See Document Model: Parameters to learn how to edit parameters of an element. The element parameter components work on element types every bit well.

One time you accept filtered out the desired type, you can extract the geometry for that element type using the component. The Level Of Detail value listing component makes it like shooting fish in a barrel to provide correct values for LOD input parameter.

The component automatically previews the geometry in Rhinoceros window.

Level Of Detail
Place under Grasshopper User Objects binder. Detect in Revit > Custom panel

The Chemical element Geometry By SubCategory component shared here helps yous extract geometry of a family unit case aslope information almost its subcategory definition inside the family. The example hither extracts the geometry from a series of window instances

Chemical element Geometry By SubCategory
Place under Grasshopper User Objects binder. Find in Revit > Custom panel

Creating New Types

To create new types, you lot would need to observe an existing type, use the ElementType.Indistinguishable component to duplicate that type with a new proper noun, and conform the desired properties.

Revit Projection Browser now displays the new type under Families

Removing Types

You can employ the Element.Delete component to delete types. Remember that deleting types will delete all instances of that type every bit well. If you don't want this, observe the instances and modify their types before deleting a type from model.

Loading Families

Utilise the Family.Load component to load a new family file into your model.

Revit Projection Browser now lists the new family nether Families

Saving Families

Use the Family.Save component to save a family into an external file.

Type Family
Identify under Grasshopper User Objects binder. Find in Revit > Custom console

Creating New Families

Nether current Rhino.Inside.Revit implementation, you tin can utilize the Family.New component to generate new Revit families and insert a new geometry into the family unit. Make sure to assign the correct template file to the component for best results.

Revit Project Browser now lists the new family under Families

You can too pass the Generic Model template to the Family unit.New component and set the category manually using the Model Categories Picker component.

At that place are a series of components nether the Revit > Family unit panel that will help you generate geometry for Revit families:

  • FamilyElement.ByBrep
  • FamilyElement.ByCurve
  • FamilyOpening.ByCurve
  • FamilyVoid.ByBrep

As shown in the instance above, you can use the Visibility.Construct component to create visibility options for the generated geometry. This components provides all the options available in the native Revit Visibility/Graphics editor for family geometries.

Editing Families

You can employ the Family.New component to edit existing families every bit well. Just laissez passer the appropriate template and family name, the new geometry, and the Family unit.New component automatically finds the existing family, replaces the content and reloads the family into the Revit model. Make certain the OverrideFamily is gear up to Truthful and OverrideParameters is gear up accordingly to override the family unit parameters if needed.