Sample Code Revit Batch Processor 1.1.11 documentation

Contents:

This Page

duHast.Revit.Stairs package

Subpackages

Submodules

duHast.Revit.Stairs.cut_marks module

This module contains a number of helper functions relating to Revit stair cut mark elements.

duHast.Revit.Stairs.cut_marks.STAIR_CUT_MARK_TYPE_PARAS = [Autodesk.Revit.DB.BuiltInParameter.STAIRSTYPE_CUTMARK_TYPE]

list of built in parameters for stair cut mark

duHast.Revit.Stairs.cut_marks.get_stair_cut_mark_types_by_class(doc)

Gets a filtered element collector of all cut mark types in the model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: A filtered element collector containing stair cut mark types. :rtype: Autodesk.Revit.DB.FilteredElementCollector

duHast.Revit.Stairs.cut_marks.get_stair_cut_mark_types_ids_by_class(doc)

Get all Stair cut mark element type ids available in model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: List of element ids representing stair cut mark types. :rtype: list of Autodesk.Revit.DB.ElementId

duHast.Revit.Stairs.landings module

This module contains a number of helper functions relating to Revit stair landing elements.

duHast.Revit.Stairs.landings.STAIR_LANDING_TYPE_PARAS = [Autodesk.Revit.DB.BuiltInParameter.STAIRSTYPE_LANDING_TYPE]

list of built in parameters attached to stair sub types

duHast.Revit.Stairs.landings.get_stair_landing_types_by_class(doc)

Gets a filtered element collector of all Stair landing types in the model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: A filtered element collector containing stair landing types. :rtype: Autodesk.Revit.DB.FilteredElementCollector

duHast.Revit.Stairs.landings.get_stair_landing_types_ids_by_class(doc)

Gets all Stair landing element type ids available in model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: List of element ids representing stair landing types. :rtype: list of Autodesk.Revit.DB.ElementId

duHast.Revit.Stairs.path module

This module contains a number of helper functions relating to Revit stair path elements.

duHast.Revit.Stairs.path.get_stair_path_types_by_class(doc)

Gets a filtered element collector of all Stair path types in the model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: A filtered element collector containing stair path types. :rtype: Autodesk.Revit.DB.FilteredElementCollector

duHast.Revit.Stairs.path.get_stair_path_types_ids_by_class(doc)

Gets all Stair path element type ids available in model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: List of element ids representing stair path types. :rtype: list of Autodesk.Revit.DB.ElementId

duHast.Revit.Stairs.path.get_all_stair_path_instances(doc)

Gets a filtered element collector of all Stair path elements in the model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: A filtered element collector containing stair path elements. :rtype: Autodesk.Revit.DB.FilteredElementCollector

duHast.Revit.Stairs.purge_unused_stair_types module

This module contains a number of helper functions relating to purging Revit stairs and stair sub element types.

duHast.Revit.Stairs.purge_unused_stair_types.BASIC_STAIR_FAMILY_NAME = 'Stair'

Built in stair family name for basic stairs

duHast.Revit.Stairs.purge_unused_stair_types.ASSEMBLED_STAIR_FAMILY_NAME = 'Assembled Stair'

Built in stair family name for assembled stairs

duHast.Revit.Stairs.purge_unused_stair_types.PRECAST_STAIR_FAMILY_NAME = 'Precast Stair'

Built in stair family name for precast stairs

duHast.Revit.Stairs.purge_unused_stair_types.CAST_IN_PLACE_STAIR_FAMILY_NAME = 'Cast-In-Place Stair'

Built in stair family name for cast in place stairs

duHast.Revit.Stairs.purge_unused_stair_types.BUILTIN_STAIR_TYPE_FAMILY_NAMES = ['Stair', 'Assembled Stair', 'Precast Stair', 'Cast-In-Place Stair']

List of all Built in stair family names

duHast.Revit.Stairs.purge_unused_stair_types.get_used_stair_type_ids(doc)

Gets all used in Stair type ids. 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 representing stair types. :rtype: list of Autodesk.Revit.DB.ElementId

duHast.Revit.Stairs.purge_unused_stair_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. :param fam_type_ids: List of family type ids to check. :type fam_type_ids: List of Autodesk.Revit.DB.ElementId :param un_used_type_ids: Reference list of ids. :type un_used_type_ids: List of Autodesk.Revit.DB.ElementId :return: True if any id from amTypeIds is not in un_used_type_ids. :rtype: bool

duHast.Revit.Stairs.purge_unused_stair_types.get_unused_non_in_place_stair_type_ids_to_purge(doc)

Gets all unused Stair type ids for. Included are: - Stair Soffit - Compound Stair - Basic Stair 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 representing unused stair types. :rtype: list of Autodesk.Revit.DB.ElementId

duHast.Revit.Stairs.purge_unused_stair_types.get_used_sub_type_ids_from_stair_type(doc, stair_type_id, paras)

Gets the id of types making up a stair. These could be stair landing types, stringer and carriage types etc. Types returned depend on parameter definitions past in. Refer to: - STAIR_LANDING_TYPE_PARAS, - STAIR_CUTMARK_TYPE_PARAS, - STAIR_SUPPORT_TYPE_PARAS

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

  • stair_type_id (Autodesk.Revit.DB.ElementId) – An element id representing a stair type.

  • paras (list Autodesk.Revit.DB.BuiltInParameterDefinition) – Parameters containing a type making up a stair.

Returns:

List of element ids representing stair types.

Return type:

list of Autodesk.Revit.DB.ElementId

duHast.Revit.Stairs.purge_unused_stair_types.get_all_similar_type_ids(doc, ids)

Gets all unique ids of similar types of element ids passed in. TODO: check for similar function elsewhere! :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :param ids: list of type ids to be added to. :type ids: list of Autodesk.Revit.ElementIds :return: List of unique ids of similar types. :rtype: list of Autodesk.Revit.ElementIds

duHast.Revit.Stairs.purge_unused_stair_types.build_system_family_dictionary(doc, ids)

Returns dictionary where key is the system family name and values list of available type ids of that system family. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :param ids: List of system family ids. :type ids: list of Autodesk.Revit.ElementIds :return: Dictionary of unique ids of similar types. :rtype: dictionary {str: list of Autodesk.Revit.ElementIds }

duHast.Revit.Stairs.purge_unused_stair_types.check_system_families(doc, ids, leave_one_behind)

Check whether a list of ids of system family is the entire list of types available in the model. If so it will remove one type id per system family to allow safe purging. Revit requires at least one type definition per system family to be in the model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :param ids: List of ids to check :type ids: list of Autodesk.Revit.ElementIds :param leave_one_behind: True: at least one type will be omitted from list. :type leave_one_behind: bool :return: List of unique ids of similar types. :rtype: list of Autodesk.Revit.ElementIds

duHast.Revit.Stairs.purge_unused_stair_types.get_used_sub_types(doc, available_ids_getter, paras, leave_one_behind=True)

Returns a list of type ids which are not used in any stair types. Type ids are provided via an id getter function :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :param available_ids_getter: function returning available type ids :type available_ids_getter: func(doc) :param paras: list of built in parameters attached to a stair type for given sub types (stringers, path, run, landing) :type paras: list of Autodesk.Revit.DB.BuiltInParameter :param leave_one_behind: _description_, defaults to True :type leave_one_behind: bool, optional :return: List of element ids :rtype: list of Autodesk.Revit.ElementIds

duHast.Revit.Stairs.purge_unused_stair_types.get_unused_stair_path_type_ids_to_purge(doc)

Gets all unused Stair path ids to purge, will omit on path type id per system family if none are used. This method can be used to safely delete unused stair path types. In the case that no stair path instance using any of the types is placed, this will return all but one type id since Revit requires at least one stair path type definition to be in the model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: List of element ids :rtype: list of Autodesk.Revit.ElementIds

duHast.Revit.Stairs.purge_unused_stair_types.get_unused_stair_landing_type_ids_to_purge(doc)

Gets all unused Stair landing type ids. This method can be used to safely delete unused stair landing types. In the case that no stair landing instance using any of the types is placed, this will return all but one type id since Revit requires at least one stair landing type definition to be in the model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: List of element ids :rtype: list of Autodesk.Revit.ElementIds

duHast.Revit.Stairs.purge_unused_stair_types.get_unused_stair_run_type_ids_to_purge(doc)

Gets all unused Stair run type ids. This method can be used to safely delete unused stair run types. In the case that no stair run instance using any of the types is placed, this will return all but one type id since Revit requires at least one stair run type definition to be in the model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: List of element ids :rtype: list of Autodesk.Revit.ElementIds

duHast.Revit.Stairs.purge_unused_stair_types.get_unused_stair_cut_mark_type_ids_to_purge(doc)

Gets all unused Stair cut mark type ids. This method can be used to safely delete unused stair cut mark types. In the case that no stair cut mark instance using any of the types is placed, this will return all but one type id since Revit requires at least one stair cut mark type definition to be in the model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: List of element ids :rtype: list of Autodesk.Revit.ElementIds

duHast.Revit.Stairs.purge_unused_stair_types.get_unused_stair_stringers_carriage_type_ids_to_purge(doc)

Gets all unused Stair stringer / carriage type ids. This method can be used to safely delete unused stair stringer / carriage types. In the case that no stair string carriage instance using any of the types is placed, this will return all but one type id since Revit requires at least one stringer carriage type definition to be in the model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: List of element ids :rtype: list of Autodesk.Revit.ElementIds

duHast.Revit.Stairs.purge_unused_stair_types.get_used_in_place_stair_type_ids(doc)

Gets all used in place stair type ids. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: List of element ids :rtype: list of Autodesk.Revit.ElementIds

duHast.Revit.Stairs.purge_unused_stair_types.get_unused_in_place_stair_type_ids(doc)

Gets all unused in place stair type ids. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: List of element ids :rtype: list of Autodesk.Revit.ElementIds

duHast.Revit.Stairs.purge_unused_stair_types.get_unused_in_place_stair_type_ids_for_purge(doc)

Gets symbol (type) ids and family ids (when no type is in use) of in place Stair families which can be purged. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: List of element ids :rtype: list of Autodesk.Revit.ElementIds

duHast.Revit.Stairs.runs module

This module contains a number of helper functions relating to Revit stair run elements.

duHast.Revit.Stairs.runs.STAIR_RUN_TYPE_PARAS = [Autodesk.Revit.DB.BuiltInParameter.STAIRSTYPE_RUN_TYPE]

list of built in parameters for stair run type

duHast.Revit.Stairs.runs.get_stair_run_types_by_class(doc)

Gets a filtered element collector of all Stair run types in the model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: A filtered element collector containing stair run types. :rtype: Autodesk.Revit.DB.FilteredElementCollector

duHast.Revit.Stairs.runs.get_stair_run_types_ids_by_class(doc)

Gets all Stair run element type ids available in model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: List of element ids representing stair run types. :rtype: list of Autodesk.Revit.DB.ElementId

duHast.Revit.Stairs.stairs module

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

duHast.Revit.Stairs.stairs.get_all_stair_types_by_category(doc)

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

Return includes: - Stair - Assembled Stair - Precast Stair - Cast-In-Place Stair - In place families or loaded families

Parameters:

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

Returns:

A filtered element collector containing stair types.

Return type:

Autodesk.Revit.DB.FilteredElementCollector

duHast.Revit.Stairs.stairs.get_all_stair_types_by_class(doc)

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

Return includes:

  • Assembled Stair

  • Precast Stair

  • Cast-In-Place Stair

It will not return any in place family or Stair types! These are internally treated as Families or Family Symbols class objects.

Parameters:

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

Returns:

A filtered element collector containing stair types.

Return type:

Autodesk.Revit.DB.FilteredElementCollector

duHast.Revit.Stairs.stairs.get_all_stair_instances_by_category(doc)

Gets a filtered element collector of all Stair elements placed in model.

TODO: Confirm it ignores in place families?

Parameters:

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

Returns:

A filtered element collector containing stair instances.

Return type:

Autodesk.Revit.DB.FilteredElementCollector

duHast.Revit.Stairs.stairs.get_all_stair_instances_by_class(doc)

Gets a filtered element collection all Stair elements placed in model…

TODO: Confirm it ignores Stair soffits.

Parameters:

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

Returns:

A filtered element collector containing stair instances.

Return type:

Autodesk.Revit.DB.FilteredElementCollector

duHast.Revit.Stairs.stairs.get_all_stair_type_ids_by_category(doc)

Gets all Stair element type ids available in model.

Parameters:

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

Returns:

List of element ids representing stair types.

Return type:

list of Autodesk.Revit.DB.ElementId

duHast.Revit.Stairs.stairs.get_all_stair_type_ids_by_class(doc)

Gets all Stair element type ids available in model.

Ignores in place families of category stair.

Parameters:

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

Returns:

List of element ids representing stair types.

Return type:

list of Autodesk.Revit.DB.ElementId

duHast.Revit.Stairs.stairs.get_in_place_stair_family_instances(doc)

Gets all instances in place families of category stair.

Parameters:

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

Returns:

A filtered element collector containing in place stair family instances.

Return type:

Autodesk.Revit.DB.FilteredElementCollector

duHast.Revit.Stairs.stairs.get_all_in_place_stair_type_ids(doc)

Gets all type ids off all available in place families of category stair.

Parameters:

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

Returns:

List of element ids

Return type:

list of Autodesk.Revit.ElementIds

duHast.Revit.Stairs.stringers_carriages module

This module contains a number of helper functions relating to Revit stair stringers and carriage elements.

duHast.Revit.Stairs.stringers_carriages.STAIR_SUPPORT_TYPE_PARAS = [Autodesk.Revit.DB.BuiltInParameter.STAIRSTYPE_LEFT_SIDE_SUPPORT_TYPE, Autodesk.Revit.DB.BuiltInParameter.STAIRSTYPE_INTERMEDIATE_SUPPORT_TYPE, Autodesk.Revit.DB.BuiltInParameter.STAIRSTYPE_RIGHT_SIDE_SUPPORT_TYPE]

list of built in parameters for stair support types

duHast.Revit.Stairs.stringers_carriages.get_all_stair_stringers_carriage_by_category(doc)

Gets a filtered element collector of all stair stringers and carriage types in the model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: A filtered element collector containing stair stringers and carriage types. :rtype: Autodesk.Revit.DB.FilteredElementCollector

duHast.Revit.Stairs.stringers_carriages.get_all_stair_stringers_carriage_type_ids_by_category(doc)

Get all Stair stringers and carriage element type ids available in model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: List of element ids representing stair stringer and carriage types. :rtype: list of Autodesk.Revit.DB.ElementId

Module contents