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:

• Identity
• Graphics
• Appearance Properties
• Physical Properties
• Thermal Properties

Each one of these aspects is represented by a tab in the Revit material editor window:

In Grasshopper, there are 5 main components to break down these 5 aspects of a material:

• Material Identity
• Material Graphics+ v1.0
• Analyze Appearance Asset (Generic)
• Analyze Physical Asset+ v1.0
• Analyze Thermal Asset

These components are shown below. The Extract Material’s Assets is used to extract Assets (Appearance, Physical, and Thermal) from the material and each can be analyzed with their own respective “Analyze” components listed above. Scroll to Material Assets to see more information on the various assets:

In the sections below, we will discuss how to deal with all of these 5 aspects using Rhino.Inside.Revit

## Querying Materials

 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 < Starts with> Ends with? Contains, same as a regular search: Wildcards; Regular expression

## Material Identity

Use the Material Identity component to access the material identity:

You can make changes to the identity properties using the same component:

## Material Graphics

Use the Material Graphics+ v1.0 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:

## Creating Materials

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+ v1.0 , Material Identity , or Replace Material’s Assets to assign graphic properties to the new material:

## Material Assets

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

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   Appearance Assets All Appearance assets are of type DB.Visual.Asset and are basically a collection of visual properties that have a name e.g. generic_diffuse, a type, and a value. The DB.Visual.Asset has lookup methods to find and return these properties. These properties are wrapped by the type DB.Visual.AssetProperty in Revit API. This type provides getters to extract the value from the property.   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 GenericDiffuse property of DB.Visual.Generic, returns the name generic_diffuse which is the name of the diffuse property for a Generic Appearance asset.   Appearance assets are then wrapped by DB.AppearanceAssetElement so they can be assigned to a Revit Material (DB.Material)   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. THERMAL_MATERIAL_PARAM_REFLECTIVITY of DB.BuiltInParameter   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:     Open using Grasshopper in Rhino.Inside.Revit

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

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:

## Texture Assets

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.

## Physical Assets

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.

## Thermal 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.