Sample Code Revit Batch Processor 1.1.11 documentation

Contents:

This Page

duHast.Revit.Areas package

Subpackages

Submodules

duHast.Revit.Areas.area_lines module

Revit areas helper functions.

duHast.Revit.Areas.area_lines.get_area_lines_by_area_scheme_name(doc, scheme_name)

Returns a list of Revit model lines that are associated with a specific area scheme.

Args:

doc (Revit Document): The Revit document object. scheme_name (str): The name of the area scheme.

Returns:

list: A list of Revit elements representing the area lines associated with the specified area scheme.

duHast.Revit.Areas.area_lines.get_area_lines_by_scheme_and_level_name(doc, scheme_name, level_name)

Returns a list of area lines based on the area scheme and level name.

Args:

doc (Document): The current model document. scheme_name (str): The name of the area scheme. level_name (str): The name of the level.

Returns:

list: A list of area lines based on the area scheme and level name or None if no area lines attached to scheme and level.

duHast.Revit.Areas.area_lines.sort_area_line_by_level_name(doc, area_lines)

Sorts the area lines based on their associated level names and returns a dictionary where the keys are the level names and the values are lists of area lines.

Args:

doc (Document): The current model document. area_lines (list): A list of area lines.

Returns:

dict: A dictionary where the keys are the level names and the values are lists of area lines.

duHast.Revit.Areas.area_lines.delete_area_lines_by_level_name(doc, level_name, area_lines, transaction_manager=<function in_transaction>)

Deletes area lines in a Revit model based on their associated level name.

Args:

doc (Document): The current model document. level_name (str): The name of the level to delete area lines from. area_lines (list): A list of area lines to be deleted. transaction_manager (function, optional): A function that manages the transaction. Defaults to in_transaction.

Returns:
Result: A Result class instance containing the following attributes:
  • status (bool): True if the delete operation was successful, False otherwise.

  • message (str): A message indicating the status of the delete operation.

  • result (list): A list of remaining area lines after the delete operation.

duHast.Revit.Areas.area_lines.create_new_area_outlines(doc, curves, view, transaction_manager=<function in_transaction>)

Create new area separation lines in a specified view in Autodesk Revit.

Args:

doc (Revit Document): The Revit document in which the area separation lines will be created. curves (list): A list of curves representing the area separation lines. view (Revit View): The view in which the area separation lines will be created. transaction_manager (function, optional): A transaction manager function that wraps the creation of area separation lines in a Revit transaction. Default is in_transaction.

Returns:

Result: A Result object that contains the status of the transaction and any error or success messages.

duHast.Revit.Areas.area_lines.copy_area_lines_to_level_name(doc, view, area_lines, transaction_manager=<function in_transaction>)

Copy area separation lines from one level to another in Autodesk Revit.

Args:

doc (Revit Document): The Revit document in which the area separation lines exist. view (Revit View): The view in which the area separation lines will be created. area_lines (list): A list of area separation lines to be copied. transaction_manager (function, optional): A transaction manager function that wraps the creation of area separation lines in a Revit transaction. Default is in_transaction.

Returns:

Result: A Result object that contains the status of the transaction and any error or success messages.

duHast.Revit.Areas.areas module

Revit areas helper functions.

duHast.Revit.Areas.areas.get_areas_by_scheme_name(doc, scheme_name)

Retrieves a list of areas that belong to a specific area scheme.

Args:

doc (Revit document): The Revit document from which to retrieve the areas. scheme_name (str): The name of the area scheme to filter the areas by.

Returns:

list: A list of areas that belong to the specified area scheme.

duHast.Revit.Areas.areas.get_area_schemes(doc)

Retrieves all area schemes in Autodesk Revit.

Args:

doc (Revit Document): The Revit document in which to search for area schemes.

Returns:

area_schemes: A collection of area schemes in the Revit document.

duHast.Revit.Areas.areas.get_area_scheme_by_name(doc, area_scheme_name)

Retrieves an area scheme by its name in Autodesk Revit.

Args:

doc (Revit Document): The Revit document in which to search for the area scheme. area_scheme_name (str): The name of the area scheme to retrieve.

Returns:

AreaScheme: The area scheme with the specified name, or None if no match is found.

duHast.Revit.Areas.areas.get_views_by_area_scheme_name(doc, area_scheme_name)

Retrieves all views associated with a given area scheme name in Autodesk Revit.

Args:

doc (Revit Document): The Revit document in which to search for views. area_scheme_name (str): The name of the area scheme to filter views by.

Returns:

list: A list of ViewPlan objects that are associated with the given area scheme name.

Module contents