Sample Code Revit Batch Processor 1.1.11 documentation

Contents:

This Page

duHast.Revit.Roofs package

Subpackages

Submodules

duHast.Revit.Roofs.purge_unused_roof_types module

This module contains a number of helper functions relating to purging Revit roofs.

duHast.Revit.Roofs.purge_unused_roof_types.get_used_roof_type_ids(doc)

Gets all used in Roof type ids in the model. Used: at least one instance of this type is placed in the model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: List of element ids of roof types. :rtype: List Autodesk.Revit.DB.ElementId

duHast.Revit.Roofs.purge_unused_roof_types.family_no_types_in_use(famTypeIds, unUsedTypeIds)

Compares two lists of element ids and returns False if any element id in first list is not in the second list. Returns False if any symbols (types) of a family (first lists) are in use in a model (second list). TODO: repetitive code…Consider generic function! :param famTypeIds: List of family symbols (types). :type famTypeIds: List of Autodesk.Revit.DB.ElementId :param unUsedTypeIds: List of unused family symbols (types) :type unUsedTypeIds: List of Autodesk.Revit.DB.ElementId :return: True if all ids in first list are also in second list, otherwise False. :rtype: bool

duHast.Revit.Roofs.purge_unused_roof_types.get_unused_non_in_place_roof_type_ids_to_purge(doc)

Gets all unused Roof type ids in the model. This method can be used to safely delete unused roof types. In the case that no roof instance using any of the types is placed, this will return all but one type id since Revit requires at least one roof type definition to be in the model. Unused: Not one instance of this type is placed in the model. - Roof Soffit - Compound Roof - Basic Roof It will therefore not return any in place family types. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: List of element ids of roof types. :rtype: List Autodesk.Revit.DB.ElementId

duHast.Revit.Roofs.purge_unused_roof_types.get_used_in_place_roof_type_ids(doc)

Gets all used in place roof type ids in the model. Used: at least one instance of this type is placed in the model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: List of element ids of in place roof types. :rtype: List Autodesk.Revit.DB.ElementId

duHast.Revit.Roofs.purge_unused_roof_types.get_unused_in_place_roof_type_ids(doc)

Gets all unused in place roof type ids in the model. Unused: Not one instance of this type is placed in the model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: List of element ids of in place roof types. :rtype: List Autodesk.Revit.DB.ElementId

duHast.Revit.Roofs.purge_unused_roof_types.get_unused_in_place_roof_type_ids_for_purge(doc)

Gets symbol(type) ids and family ids (when no type is in use of a family) of in place Roof families which can be purged. This method can be used to safely delete unused in place roof types. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: List of element ids of in place roof types. :rtype: List Autodesk.Revit.DB.ElementId

duHast.Revit.Roofs.roofs module

This module contains a number of helper functions relating to Revit roofs.

duHast.Revit.Roofs.roofs.get_all_roof_types_by_category(doc)

Gets a filtered element collector of all roof types in the model.

  • Basic Roof

  • In place families or loaded families

  • sloped glazing

Parameters:

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

Returns:

A filtered element collector containing roof types.

Return type:

Autodesk.Revit.DB.FilteredElementCollector

duHast.Revit.Roofs.roofs.get_all_roof_types_by_class(doc)

Gets a filtered element collector of all Roof types in the model:

  • Basic Roof

  • sloped glazing

Since this is based of class roof it will therefore not return any in place family types!

Parameters:

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

Returns:

A filtered element collector containing roof types.

Return type:

Autodesk.Revit.DB.FilteredElementCollector

duHast.Revit.Roofs.roofs.get_all_roof_instances_by_category(doc)

Gets all Roof elements placed in model…ignores in place families (to be confirmed!)

Parameters:

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

Returns:

A filtered element collector containing roof instances.

Return type:

Autodesk.Revit.DB.FilteredElementCollector

duHast.Revit.Roofs.roofs.get_all_roof_instances_by_class(doc)

Gets all Roof elements placed in model…ignores roof soffits(???)

Parameters:

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

Returns:

A filtered element collector containing roof instances.

Return type:

Autodesk.Revit.DB.FilteredElementCollector

duHast.Revit.Roofs.roofs.get_all_roof_type_ids_by_category(doc)

Gets all Roof element type ids available in model.

Parameters:

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

Returns:

List of element ids of roof types.

Return type:

List Autodesk.Revit.DB.ElementId

duHast.Revit.Roofs.roofs.get_all_roof_type_ids_by_class(doc)

Gets all Roof element type ids available in model.

Parameters:

doc (_type_) – _description_

Returns:

List of element ids of roof types.

Return type:

List Autodesk.Revit.DB.ElementId

duHast.Revit.Roofs.roofs.get_in_place_roof_family_instances(doc)

Gets all instances of in place families of category roof in the model.

Parameters:

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

Returns:

A filtered element collector containing roof family instances.

Return type:

Autodesk.Revit.DB.FilteredElementCollector

duHast.Revit.Roofs.roofs.get_all_in_place_roof_type_ids(doc)

Gets type ids off all available in place families of category roof in the model.

Parameters:

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

Returns:

List of element ids of in place roof types.

Return type:

List Autodesk.Revit.DB.ElementId

Module contents