Sample Code Revit Batch Processor 1.1.11 documentation

Contents:

This Page

duHast.pyRevit package

Subpackages

Submodules

duHast.pyRevit.console_output module

A number of helper functions relating to py pyrevit output to console duHast result class.

duHast.pyRevit.console_output.print_result(result, header=None)

Prints a result class instance to the pyRevit console.

Parameters:
  • result (Result) – The result instance to be printed.

  • header (str) – The header to be printed before the result.

duHast.pyRevit.console_output.print_header(header)

Prints a header to the pyRevit console.

Parameters:

header (str) – The header to be printed.

duHast.pyRevit.ui_element_selection module

This module contains a number of helper functions relating to py Revit element selection from list.

duHast.pyRevit.ui_element_selection.default_name_builder(element)

Deafult element name builder is used to build the element name shown in the UI by combining the element name and element Id

Parameters:

element (Autodesk.Revit.DB.Element) – An element

Returns:

A name of the element.

Return type:

str

duHast.pyRevit.ui_element_selection.get_element_selection_from_user(doc, forms, element_getter, element_selection_description, multiselect=True, ui_element_name_builder=<function default_name_builder>)

lists Elements provided by element getter function in UI and returns the users selection

Parameters:
  • doc (Autodesk.Revit.DB.Document) – Ther current Revit model.

  • forms (_type_) – pyRevit forms

  • element_getter (_type_) – Function accpeting the document as the only argument returning a list of elements or empty list.

  • element_selection_description (str) – Text to be displayes on button to prompt user

Returns:

None if nothing was selected. Otherwise a list of element ids

Return type:

None or [Autodesk.Revit.ElementId]

Module contents