Sample Code Revit Batch Processor 1.1.11 documentation

Contents:

This Page

duHast.Revit.Floors package

Subpackages

Submodules

duHast.Revit.Floors.floors module

Revit floors helper functions.

duHast.Revit.Floors.floors.FLOOR_FAMILY_NAME = 'Floor'

Built in family name for standard floor

duHast.Revit.Floors.floors.FOUNDATION_SLAB_FAMILY_NAME = 'Foundation Slab'

Built in family name for a foundation slab

duHast.Revit.Floors.floors.BUILTIN_FLOOR_TYPE_FAMILY_NAMES = ['Floor', 'Foundation Slab']

List of all Built in floor family names

duHast.Revit.Floors.floors.get_all_floor_types_by_category(doc)

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

  • Compound Ceiling

  • In place families or loaded families

  • Basic Ceiling

Filters by category. It will therefore not return any roof soffit types ..

Parameters:

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

Returns:

A filtered element collector containing ceiling types.

Return type:

Autodesk.Revit.DB.FilteredElementCollector

duHast.Revit.Floors.floors.get_floor_types_by_class(doc)

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

  • Roof Soffit

  • Compound Ceiling

  • Basic Ceiling

Filters by class. 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 ceiling types.

Return type:

Autodesk.Revit.DB.FilteredElementCollector

duHast.Revit.Floors.floors.get_all_floor_instances_in_model_by_category(doc)

Gets all floor elements placed in model…ignores in foundation slabs.

Filters by builtin category.

Parameters:

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

Returns:

A filtered element collector containing floor instances.

Return type:

Autodesk.Revit.DB.FilteredElementCollector

duHast.Revit.Floors.floors.get_all_floor_instances_in_model_by_class(doc)

Gets all floor elements placed in model…ignores in place families of category floor.

Filters by class.

Parameters:

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

Returns:

A filtered element collector containing floor instances.

Return type:

Autodesk.Revit.DB.FilteredElementCollector

duHast.Revit.Floors.floors.get_all_floor_type_ids_in_model_by_category(doc)

Returns all Floor element types available in model.

Filters by builtin category.

Parameters:

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

Returns:

A filtered element collector containing floor types.

Return type:

Autodesk.Revit.DB.FilteredElementCollector

duHast.Revit.Floors.floors.get_all_floor_type_ids_in_model_by_class(doc)

Returns all Floor element types available in model.

Filters by class.

Parameters:

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

Returns:

A filtered element collector containing floor types.

Return type:

Autodesk.Revit.DB.FilteredElementCollector

duHast.Revit.Floors.floors.get_in_place_floor_family_instances(doc)

Gets all instances of in place families of category floor.

Parameters:

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

Returns:

A filtered element collector containing floor family instances.

Return type:

Autodesk.Revit.DB.FilteredElementCollector

duHast.Revit.Floors.floors.get_all_in_place_floor_type_ids_in_model(doc)

Gets type ids off all available in place families symbols (types) of category floor.

Parameters:

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

Returns:

List of element ids representing in place floor symbols (types).

Return type:

list of Autodesk.Revit.DB.ElementId

duHast.Revit.Floors.purge_unused_floor_types module

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

duHast.Revit.Floors.purge_unused_floor_types.get_used_floor_type_ids(doc)

Returns all used in Floor type ids. Filters by builtin category. Used: at least one instance of this type is placed in the model.

Parameters:

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

Returns:

List of element ids representing not used floor types.

Return type:

list of Autodesk.Revit.DB.ElementId

duHast.Revit.Floors.purge_unused_floor_types.family_no_types_in_use(fam_type_ids, un_used_type_ids)

Compares two lists of ids. True if any id is not in un_used_type_ids. TODO: check for more generic list comparison and remove this function.

Parameters:
  • fam_type_ids (List of Autodesk.Revit.DB.ElementId) – List of family type ids to check.

  • un_used_type_ids (List of Autodesk.Revit.DB.ElementId) – Reference list of ids.

Returns:

True if any id from fam_type_ids is not in un_used_type_ids.

Return type:

bool

duHast.Revit.Floors.purge_unused_floor_types.get_unused_non_in_place_floor_type_ids_to_purge(doc)

Gets all unused floor type id’s. This method can be used to safely delete unused wall types: In the case that no wall instance using any of the types is placed this will return all but one type id since Revit requires at least one wall type definition to be in the model. Filters by class: - Floor - foundation slab It will therefore not return any in place family types.

Parameters:

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

Returns:

List of element ids representing not used floor types.

Return type:

list of Autodesk.Revit.DB.ElementId

duHast.Revit.Floors.purge_unused_floor_types.get_used_in_place_floor_type_ids(doc)

Gets all used in place family symbol (type) ids. Used: at least one instance of this type is placed in the model.

Parameters:

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

Returns:

List of element ids representing in place floor symbols (types).

Return type:

list of Autodesk.Revit.DB.ElementId

duHast.Revit.Floors.purge_unused_floor_types.get_unused_in_place_floor_type_ids(doc)

Gets all used in place family symbol (type) ids. Unused: Not one instance of this type is placed in the model.

Parameters:

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

Returns:

List of element ids representing in place floor symbols (types).

Return type:

list of Autodesk.Revit.DB.ElementId

duHast.Revit.Floors.purge_unused_floor_types.get_unused_in_place_floor_ids_for_purge(doc)

Gets symbol(type) ids and family ids (when no type is in use) of in place floor families which can be safely deleted from the model. This method can be used to safely delete unused in place floor types. There is no requirement by Revit to have at least one in place wall definition in the model.

Parameters:

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

Returns:

List of element ids representing unused in place floor types and families.

Return type:

list of Autodesk.Revit.DB.ElementId

Module contents