Materials are one of the more complicated data types in Revit. They are regularly used to (a) assign graphical properties to Revit elements for drafting (e.g. tile pattern on a bathroom wall), (b) embed architectural finish information in the building model for the purpose of scheduling and takeouts, (c) assign appearance properties to surfaces for architectural visualizations, and (d) assign physical and (e) thermal properties to elements for mathematical analysis of all kinds.
Therefore a single Material in Revit has 5 main aspects:
- Appearance Properties
- Physical Properties
- Thermal Properties
Each one of these aspects is represented by a tab in the Revit material editor window:
In the sections below, we will discuss how to deal with all of these 5 aspects using Rhino.Inside.Revit
In Revit API, Materials are represented by the DB.Material. This type, handles the Identity and Graphics of a material and provides methods to query and modify the Appearance, Physical, and Thermal properties.
The first challenge is to be able to query available materials in a Revit model or find a specific one that we want to work with. For this we use the Query Materials component. The component outputs all the materials in a Revit model by default, and also has optional inputs to filter the existing materials by class or name, and also accepts customs filters as well:
The Class and Name inputs accept Grasshopper string filtering patterns
Extracting Materials from Geometry
To extract the set of materials assigned to faces of a geometry, use the Geometry Materials component shared here. In this example, a custom component is used to extract the geometry objects from Revit API (DB.Solid - See Extracting Type Geometry by Category). These objects are then passed to the Geometry Materials component to extract materials. Finally the Element.Decompose component is used to extract the material name.
Place under Grasshopper User Objects folder. Find in Revit > Custom panel
Use the Material Identity component to access the material identity:
You can make changes to the identity properties using the same component:
Use the Material Graphics component to access the material graphics:
You can make changes to the graphic properties using the same component. See Styles and Patterns page for the Find Fill Pattern component:
Use the Add Material document-aware component to create a new material in the Revit model. You must assign a unique name to the new material:
After creating the material, use the Material Graphics component to assign graphic properties to the new material:
So far, we have learned how to analyze material identify and graphics, and to create simple materials. To be able to take full advantage of the materials in Revit, we need to be familiar with the underlying concepts behind the other three aspects of a material: Appearance, Physical, and Thermal properties.
Assets are the underlying concept behind the Appearance, Physical, and Thermal aspects of a material in Revit. Rhino.Inside.Revit provides a series of components to Create, Modify, and Analyze these assets in a Grasshopper-friendly manner. It also provides components to extract and replace these assets on a Revit material.
Remember that Assets and Materials are different data types. Each Revit Material had identity and graphics properties, and also can be assigned Assets to apply Appearance, Physical, and Thermal properties to the Material. Having Physical, and Thermal assets is completely optional.
Revit API support for assets is very limited. This note section, attempts to describe the inner-workings of Revit Visual API
All Appearance assets are of type DB.Visual.Asset and are basically a collection of visual properties that have a name e.g.
There are many different Appearance assets in Revit e.g. Generic, Ceramic, Metal, Layered, Glazing to name a few. Each asset has a different set of properties. To work with these Appearance assets, we need a way to know the name of the properties that are available for each of the asset types. Revit API provides static classes with static readonly string properties that provide an easy(?) way to get the name of these properties. For example the
Physical and Thermal Assets
Physical, and Thermal assets are completely different although operating very similarly to Appearance assets. They are still a collection of properties, however, the properties are modeled as Revit parameters (DB.Parameter) and are collected by an instance of DB.PropertySetElement. Instead of having static classes as accessors for the names, they must be accessed by looking up the parameter based on a built-in Revit parameter e.g.
Revit API provides DB.StructuralAsset and DB.ThermalAsset types to provide easy access to the Physical, and Thermal properties, however, not all the properties are included in these types and the property values are not checked for validity either.
Grasshopper as Playground
The Grasshopper definition provided here, has custom python components that help you interrogate the properties of these assets:
Use the Extract Material’s Assets to extract assets of a material:
To replace assets of a material with a different asset, use the Replace Material’s Assets component:
Appearance Assets are called the rendering material in other products. There are many components in Grasshopper to manipulate Appearance assets.
There are many Appearance assets in Revit API. As an example, you can use Create Appearance Asset to create a Generic appearance asset and assign that to a Revit material using the Replace Material’s Assets component:
The Analyze Appearance Asset (Generic) and Modify Appearance Asset (Generic) components can be used to easily manipulate an existing asset, or analyze and extract the known property values:
Appearance assets have a series of properties that can accept a nested asset (called Texture assets in this guide). For example, the diffuse property of a Generic appearance asset can either have a color value, or be connected to another asset of type Bitmap (or other Texture assets).
Rhino.Inside.Revit provides component to construct and destruct these asset types. The Appearance asset component also accepts a Texture asset where applicable. For example, use Construct Bitmap Asset and Deconstruct Bitmap Asset to construct and destruct Bitmap texture assets:
The Glossiness and Bump parameters of Generic appearance components accept both a double or color value, or a texture map respectively. Note the parameter icons show a double or color value and a checker map in background
Note that Construct an Deconstruct texture components only pass around a data structure containing the configuration of the texture asset. They do not create anything inside the Revit model by themselves. It is the Create Appearance Asset component that actually creates the texture asset (when connected to an input parameter) and connects it to properties of the appearance asset it is creating. This behavior mirrors the inner-workings of ‘connected’ (nested) assets in Revit API.
Use Create Physical Asset document-aware component to create a Physical asset and assign to a material using Replace Material’s Assets component. Use Physical Asset Class and Physical/Thermal Asset Behaviour as inputs, to set the type and behavior of the Physical asset, respectively:
Similar to the modify and analyze components discussed above, you can use Analyze Physical Asset+ v1.0 and Modify Physical Asset+ v1.0 to modify or analyze existing Physical assets.
Use Create Thermal Asset document-aware component to create a Thermal asset and assign to a material using Replace Material’s Assets component. Use Thermal Asset Class and Physical/Thermal Asset Behaviour as inputs, to set the type and behavior of the Thermal asset, respectively:
Similar to the modify and analyze components discussed above, you can use Analyze Thermal Asset and Modify Thermal Asset to modify or analyze existing Thermal assets.