Sample Code Revit Batch Processor 1.1.11 documentation

Contents:

This Page

duHast.Revit.MEP_Systems.Utility package

Submodules

duHast.Revit.MEP_Systems.Utility.MergeLists module

This module contains a helper functions to merge two lists into a unique list.

There are build in python function(s) to do this…

duHast.Revit.MEP_Systems.Utility.MergeLists.merge_into_unique_list(list_source, list_merge)

Merges the second list into the first by adding elements from second list which are not already in first list. TODO: Consider more generic code! :param list_source: List to add unique values to. :type list_source: list var :param list_merge: List containing values. :type list_merge: list var :return: List of unique objects. :rtype: list var

duHast.Revit.MEP_Systems.Utility.RevitMEPSystemCategories module

Revit MEP built-in categories.

  • useful for filtering out families which can be used in MEP system types

duHast.Revit.MEP_Systems.Utility.RevitMEPSystemCategories.CATS_LOADABLE_CABLE_TRAYS = [Autodesk.Revit.DB.BuiltInCategory.OST_CableTrayFitting]

List of loadable built in family categories for cable tray related elements.

duHast.Revit.MEP_Systems.Utility.RevitMEPSystemCategories.CATS_LOADABLE_CONDUITS = [Autodesk.Revit.DB.BuiltInCategory.OST_ConduitFitting]

List of loadable built in family categories for conduit related elements.

duHast.Revit.MEP_Systems.Utility.RevitMEPSystemCategories.CATS_LOADABLE_PIPES = [Autodesk.Revit.DB.BuiltInCategory.OST_PipeAccessory, Autodesk.Revit.DB.BuiltInCategory.OST_PipeFitting]

List of loadable built in family categories for pipe related elements.

duHast.Revit.MEP_Systems.Utility.RevitMEPSystemCategories.ROUTING_PREF_RULE_GROUP_TYPES = [Autodesk.Revit.DB.RoutingPreferenceRuleGroupType.Segments, Autodesk.Revit.DB.RoutingPreferenceRuleGroupType.Elbows, Autodesk.Revit.DB.RoutingPreferenceRuleGroupType.Junctions, Autodesk.Revit.DB.RoutingPreferenceRuleGroupType.Crosses, Autodesk.Revit.DB.RoutingPreferenceRuleGroupType.Transitions, Autodesk.Revit.DB.RoutingPreferenceRuleGroupType.Unions, Autodesk.Revit.DB.RoutingPreferenceRuleGroupType.MechanicalJoints, Autodesk.Revit.DB.RoutingPreferenceRuleGroupType.TransitionsRectangularToRound, Autodesk.Revit.DB.RoutingPreferenceRuleGroupType.TransitionsRectangularToOval, Autodesk.Revit.DB.RoutingPreferenceRuleGroupType.TransitionsOvalToRound, Autodesk.Revit.DB.RoutingPreferenceRuleGroupType.Caps]

List of routing reference rule group types

duHast.Revit.MEP_Systems.Utility.RevitMEPSystemNames module

Revit MEP systems names (ENG).

duHast.Revit.MEP_Systems.Utility.RevitMEPSystemNames.DUCT_OVAL_FAMILY_NAME = 'Oval Duct'

Built in family name for oval ducting

duHast.Revit.MEP_Systems.Utility.RevitMEPSystemNames.DUCT_ROUND_FAMILY_NAME = 'Round Duct'

Built in family name for round ducting

duHast.Revit.MEP_Systems.Utility.RevitMEPSystemNames.DUCT_RECTANGULAR_FAMILY_NAME = 'Rectangular Duct'

Built in family name for rectangular ducting

duHast.Revit.MEP_Systems.Utility.RevitMEPSystemNames.BUILTIN_DUCT_TYPE_FAMILY_NAMES = ['Oval Duct', 'Round Duct', 'Rectangular Duct']

List of all Built in ducting family names

duHast.Revit.MEP_Systems.Utility.RevitMEPSystemNames.FLEX_DUCT_REC_FAMILY_NAME = 'Flex Duct Rectangular'

Built in family name for rectangular flex ducting

duHast.Revit.MEP_Systems.Utility.RevitMEPSystemNames.FLEX_DUCT_ROUND_FAMILY_NAME = 'Flex Duct Round'

Built in family name for round flex ducting

duHast.Revit.MEP_Systems.Utility.RevitMEPSystemNames.BUILTIN_FLEX_DUCT_TYPE_FAMILY_NAMES = ['Flex Duct Rectangular', 'Flex Duct Round']

List of all Built in flex ducting family names

duHast.Revit.MEP_Systems.Utility.RevitMEPSystemNames.CONDUIT_WITH_FITTING_FAMILY_NAME = 'Conduit with Fittings'

Built in family name for conduits with fittings

duHast.Revit.MEP_Systems.Utility.RevitMEPSystemNames.CONDUIT_WITHOUT_FITTING_FAMILY_NAME = 'Conduit without Fittings'

Built in family name for conduits without fittings

duHast.Revit.MEP_Systems.Utility.RevitMEPSystemNames.BUILTIN_CONDUIT_TYPE_FAMILY_NAMES = ['Conduit with Fittings', 'Conduit without Fittings']

List of all Built in conduit family names

duHast.Revit.MEP_Systems.Utility.RevitMEPSystemNames.CABLE_TRAY_WITH_FITTING_FAMILY_NAME = 'Cable Tray with Fittings'

Built in family name for cable tray with fittings

duHast.Revit.MEP_Systems.Utility.RevitMEPSystemNames.CABLET_RAY_WITHOUT_FITTING_FAMILY_NAME = 'Cable Tray without Fittings'

Built in family name for cable tray without fittings

duHast.Revit.MEP_Systems.Utility.RevitMEPSystemNames.BUILTIN_CABLE_TRAY_TYPE_FAMILY_NAMES = ['Cable Tray with Fittings', 'Cable Tray without Fittings']

List of all Built in cable tray family names

duHast.Revit.MEP_Systems.Utility.RevitMEPSystemNames.PIPE_FAMILY_NAME = 'Pipe Types'

Built in family name for pipes

duHast.Revit.MEP_Systems.Utility.RevitMEPSystemNames.BUILTIN_PIPE_TYPE_FAMILY_NAMES = ['Pipe Types']

List of all Built in pipe family names

duHast.Revit.MEP_Systems.Utility.RevitMEPTypeSorting module

This module contains a number of helper functions relating to building MEP ype dictionaries.

TODO: similar function exists in Walls module. Consider more generic function.

duHast.Revit.MEP_Systems.Utility.RevitMEPTypeSorting.build_type_dictionary(collector, dic)

Returns the dictionary past in with keys and or values added retrieved from collector past in.

TODO: similar function exists in Walls module. Consider more generic function.

Parameters:
  • collector (Autodesk.Revit.DB.FilteredElementCollector) – A filtered element collector containing railing type elements of family symbols

  • dic (Dictionary {str:[Autodesk.Revit.DB.ElementId]}) – dictionary containing key: railing type family name, value: list of ids

Returns:

A dictionary where key is the family name and values are ids of types belonging to that family.

Return type:

Dictionary {str:[Autodesk.Revit.DB.ElementId]}

duHast.Revit.MEP_Systems.Utility.RevitMEPTypeSorting.sort_types_by_family_name(doc, type_getter)

Returns a dictionary where key is the family name and values are ids of types belonging to that family. TODO: similar function exists in Walls module. Consider more generic function. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :param type_getter: function returning element types :type type_getter: func(doc) -> Autodesk.Revit.DB.FilteredElementCollector :return: A dictionary where key is the family name and values are ids of types belonging to that family. :rtype: Dictionary {str:[Autodesk.Revit.DB.ElementId]}

duHast.Revit.MEP_Systems.Utility.SymbolsInSystemTypes module

This module contains a number of helper functions around families used in system types.

duHast.Revit.MEP_Systems.Utility.SymbolsInSystemTypes.get_unique_ids_of_used_symbols_from_system_type_id(doc, system_type_id)

Gets list of unique symbol ids used in a single system type property. List can be empty if an exception during processing occurred. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :param system_type_id: MEP system type id (pipe, conduit, duct, cable tray) :type system_type_id: Autodesk.Revit.DB.ElementId :return: List of unique ids representing family symbols used in a system. :rtype: list Autodesk.Revit.DB.ElementId

duHast.Revit.MEP_Systems.Utility.SymbolsInSystemTypes.get_unique_ids_of_used_symbols_from_system_type_ids(doc, system_type_ids)

Gets a list of unique symbol ids used in these MEP system type properties: - Cross - Elbow - MultiShapeTransition - Tap - Tee - Transition - Union :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :param system_type_ids: List of MEP system type id belonging to pipe, conduit, duct or cable tray. :type system_type_ids: List Autodesk.Revit.DB.ElementId :return: List of unique ids representing family symbols used in mep systems. :rtype: list Autodesk.Revit.DB.ElementId

duHast.Revit.MEP_Systems.Utility.SymbolsInSystemTypes.get_symbol_ids_of_mep_system_types(doc, category_list, system_type_name)

Gets list of symbol ids belonging to provided categories loaded in the model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :param category_list: List of built in categories to filter symbols by. :type category_list: list Autodesk.Revit.DB.BuiltInCategory :param system_type_name: Used in exception message to identify the mep system :type system_type_name: str :return: List of ids representing family symbols. :rtype: list Autodesk.Revit.DB.ElementId

Module contents