Sample Code Revit Batch Processor 1.1.11 documentation

Contents:

This Page

duHast.Revit.Railings package

Subpackages

Submodules

duHast.Revit.Railings.balusters module

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

duHast.Revit.Railings.balusters.get_balusters_used_in_pattern(b_pattern)

Gets list of unique baluster family ids used in a pattern only. :param b_pattern: A revit baluster pattern. :type b_pattern: Autodesk.Revit.DB.Architecture.BalusterPattern :return: List of element ids of baluster family ids. :rtype: list Autodesk.Revit.DB.ElementId

duHast.Revit.Railings.balusters.get_used_baluster_post_ids(b_post_pattern)

Gets list of unique baluster posts ids only. Includes: - CornerPost - EndPost - StartPost :param b_post_pattern: A revit post pattern. :type b_post_pattern: Autodesk.Revit.DB.Architecture.PostPattern :return: List of element ids of baluster family ids. :rtype: list Autodesk.Revit.DB.ElementId

duHast.Revit.Railings.balusters.get_used_baluster_per_tread(b_placement)

Gets the id of the baluster per stair tread. :param b_placement: A baluster placement element. :type b_placement: Autodesk.Revit.DB.Architecture.BalusterPlacement :return: List of element ids of baluster family ids. :rtype: list Autodesk.Revit.DB.ElementId

duHast.Revit.Railings.balusters.get_all_baluster_symbols(doc)

Gets all baluster symbols (fam types) in the model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: A filtered element collector of baluster symbols (types). :rtype: Autodesk.Revit.DB.FilteredElementCollector

duHast.Revit.Railings.balusters.get_all_baluster_symbols_ids(doc)

Gets all baluster symbol (fam type) ids in the model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: List of element ids of baluster family ids. :rtype: list Autodesk.Revit.DB.ElementId

duHast.Revit.Railings.balusters.get_baluster_types_from_railings(doc)

Gets a list of unique baluster symbol (fam type) ids used in railing types in the model. Incl: - baluster patterns - baluster posts - baluster per stair There can be additional baluster symbols in the model. Those belong to loaded families which are not used in any railing type definition. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: List of element ids of baluster family ids. :rtype: list Autodesk.Revit.DB.ElementId

duHast.Revit.Railings.purge_unused_railing_and_baluster_types module

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

duHast.Revit.Railings.purge_unused_railing_and_baluster_types.get_used_railing_type_ids(doc)

Gets all used Railing element types available in model excluding in place types. 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 railing types. :rtype: list Autodesk.Revit.DB.ElementId

duHast.Revit.Railings.purge_unused_railing_and_baluster_types.family_no_types_in_use(fam_type_ids, un_used_type_ids)

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 list) are in use in a model (second list). TODO: repetitive code…Consider generic function! :param fam_type_ids: List of family symbols (types). :type fam_type_ids: List of Autodesk.Revit.DB.ElementId :param un_used_type_ids: List of unused family symbols (types) :type un_used_type_ids: 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.Railings.purge_unused_railing_and_baluster_types.get_unused_non_in_place_railing_type_ids_to_purge(doc)

Gets all unused Railing type ids for: - Top Rail - Rail support - Hand rail - Rail termination - Railing Systems - loaded families Excludes any in place family types. This method can be used to safely delete unused railing types: In the case that no railing instance using any of the types is placed, this will return all but one type id since Revit requires at least one railing type definition to be in the model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: List of element ids of railing types. :rtype: list Autodesk.Revit.DB.ElementId

duHast.Revit.Railings.purge_unused_railing_and_baluster_types.get_used_in_place_railing_type_ids(doc)

Gets all used in place railing 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 of in place railing types. :rtype: list Autodesk.Revit.DB.ElementId

duHast.Revit.Railings.purge_unused_railing_and_baluster_types.get_unused_in_place_railing_type_ids(doc)

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

duHast.Revit.Railings.purge_unused_railing_and_baluster_types.get_unused_in_place_railing_ids_for_purge(doc)

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

duHast.Revit.Railings.purge_unused_railing_and_baluster_types.get_used_baluster_type_ids(doc)

Gets all used baluster type ids in the model. Used: at least one instance of this family symbol (type) is placed in the model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: List of element ids of baluster family ids. :rtype: list Autodesk.Revit.DB.ElementId

duHast.Revit.Railings.purge_unused_railing_and_baluster_types.get_unused_baluster_type_ids(doc)

Gets all unused baluster type ids in the model. Unused: Not one instance of this family symbol (type) is placed in the model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: List of element ids of baluster family ids. :rtype: list Autodesk.Revit.DB.ElementId

duHast.Revit.Railings.purge_unused_railing_and_baluster_types.get_unused_baluster_type_ids_for_purge(doc)

Gets all unused baluster type ids in the model. Unused: at least one instance of this family symbol (type) is placed in the model. This method can be used to safely delete unused baluster families and symbols. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: List of element ids of baluster family ids. :rtype: list Autodesk.Revit.DB.ElementId

duHast.Revit.Railings.railings module

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

duHast.Revit.Railings.railings.get_all_railing_types_by_category(doc)

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

Collector will include types of: - Top Rail - Rail support - Hand rail - Rail termination - Railing Systems - In place families or loaded families

Parameters:

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

Returns:

A filtered element collector of railing related types

Return type:

Autodesk.Revit.DB.FilteredElementCollector

duHast.Revit.Railings.railings.get_all_railing_types_by_category_excl_in_place(doc)

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

Collector will include types of: - Top Rail - Rail support - Hand rail - Rail termination - Railing Systems - loaded families

Will exclude any inplace families.

Parameters:

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

Returns:

A list railing related types

Return type:

list of types

duHast.Revit.Railings.railings.get_railing_types_by_class(doc)

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

Collector will include types of: - Railing

It will therefore not return any top rail or hand rail or in place family types.

Parameters:

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

Returns:

A filtered element collector of railing types

Return type:

Autodesk.Revit.DB.FilteredElementCollector

duHast.Revit.Railings.railings.get_all_railing_instances_by_category(doc)

Gets all Railing elements placed in model.

Parameters:

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

Returns:

A filtered element collector of railing instances.

Return type:

Autodesk.Revit.DB.FilteredElementCollector

duHast.Revit.Railings.railings.get_all_railing_instances_by_class(doc)

Gets all Railing elements placed in model. Ignores any in place families.

Parameters:

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

Returns:

A filtered element collector of railing instances.

Return type:

Autodesk.Revit.DB.FilteredElementCollector

duHast.Revit.Railings.railings.get_all_railing_type_ids_by_category(doc)

Gets all railing element type ids available in model.

Parameters:

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

Returns:

List of element ids of railing types.

Return type:

List Autodesk.Revit.DB.ElementId

duHast.Revit.Railings.railings.get_all_railing_type_ids_by_class(doc)

Gets all railing element type ids available in model.

Parameters:

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

Returns:

List of element ids of railing types.

Return type:

List Autodesk.Revit.DB.ElementId

duHast.Revit.Railings.railings.get_all_railing_type_ids_by_class_and_category(doc)

Gets all Railing element types available in model excluding in place types.

Parameters:

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

Returns:

List of element ids of railing types.

Return type:

list Autodesk.Revit.DB.ElementId

duHast.Revit.Railings.railings.get_in_place_railing_family_instances(doc)

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

Parameters:

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

Returns:

A filtered element collector of railing instances.

Return type:

Autodesk.Revit.DB.FilteredElementCollector

duHast.Revit.Railings.railings.get_in_place_railing_type_ids_in_model(doc)

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

Parameters:

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

Returns:

List of element ids of in place railing types.

Return type:

list Autodesk.Revit.DB.ElementId

Module contents