Sample Code Revit Batch Processor 1.1.11 documentation

Contents:

This Page

duHast.Revit.Materials package

Subpackages

Submodules

duHast.Revit.Materials.materials module

Revit materials helper functions.

duHast.Revit.Materials.materials.get_all_materials(doc)

Gets all materials in a model.

Filter by class.

Parameters:

doc (_type_) – _description_

Returns:

A filtered element collector of materials

Return type:

Autodesk.Revit.DB.FilteredElementCollector

duHast.Revit.Materials.materials.get_material_by_id(doc, id)

Gets a material element based on a material id.

Parameters:
  • doc (Autodesk.Revit.DB.Document) – Current Revit model document.

  • id (Autodesk.Revit.DB.ElementId) – The id of material to be returned.

Returns:

A material if matching id was found. Otherwise nothing gets returned!

Return type:

Autodesk.Revit.DB.Material

duHast.Revit.Materials.materials.get_material_name_by_id(doc, id)

Gets a material name based on a material id.

Parameters:
  • doc (Autodesk.Revit.DB.Document) – Current Revit model document.

  • id (Autodesk.Revit.DB.ElementId) – Id of material of which the name is to be returned.

Returns:

The material name if matching id was found or the default value: ‘<By Category>’

Return type:

str

Module contents