Sample Code Revit Batch Processor 1.1.11 documentation

Contents:

This Page

duHast.Revit.Common.Utility package

Submodules

duHast.Revit.Common.Utility.element_copying module

This module contains a number of functions for copying elements

duHast.Revit.Common.Utility.element_copying.copy_elements_from_target_doc(destination_doc, source_doc, list_of_ids, element_str)

Copy elements from one document to another

Parameters:
  • destination_doc (Document) – The document which will be the copy destination

  • source_doc (Document) – The template document which will be the copy source

  • list_of_ids (List[ElementId]) – List of element ids to copy

  • element_str (str) – String of element type to copy for logging messages

Returns:

List of new elements

Return type:

list

duHast.Revit.Common.Utility.element_spatial_utils module

This module contains a number of utilities for an elements spatial properties

duHast.Revit.Common.Utility.element_spatial_utils.get_room_element_is_in_by_element_phase_created(element, phase_dict)

Get the room an element is in.The room phase need to match the phase the element is created in.

Parameters:
  • element (FamilyInstance) – The element to check

  • phase_dict (dict) – The dictionary of phase name to phase element id ( key is the phase name, value is the phase element id)

Returns:

The room the element is in or None if no room exists or the element is not in a room

Return type:

Room

duHast.Revit.Common.Utility.revit_to_data_conversion module

A number of functions used to revit elements to data storage classes.

duHast.Revit.Common.Utility.revit_to_data_conversion.to_colour(revit_colour)

Convertes a Revit colour instance to a ColourBase storage instance

Parameters:

revit_colour (Autodesk.Revit.DB.Color) – A revit Colour object instance

Returns:

A ColourBase storage instance

Return type:

ColourBase

Module contents