Sample Code Revit Batch Processor 1.1.11 documentation

Contents:

This Page

duHast.UI.Objects package

Subpackages

Submodules

duHast.UI.Objects.ProgressBase module

A class used to wrap a progress form into a call back function.

class duHast.UI.Objects.ProgressBase.ProgressBase(form)

Bases: Base

Class constructor.

Args:

form: The progress form to wrap

update(count, total, message=None)

Base implementation to update the progress form.

Args:

count: The current count total: The total count message: The message to display

is_cancelled()

Base implementation to check if the form has been cancelled.

Returns:

True if the form has been cancelled

duHast.UI.Objects.common_ui module

A collection of common UI elements

class duHast.UI.Objects.common_ui.AlertDialog(*args: Any, **kwargs: Any)

Bases: TaskDialog

duHast.UI.Objects.common_ui.alert(content, exitscript=True, additional_content=None)

This will display a task dialog with the given content. If exitscript is True, the script will terminate after the dialog is closed. Additional content input will be put in an expander. This could be more technical output :param content: The main content of the dialog :type content: str :param exitscript: If True, the script will terminate after dialog close, defaults to True :type exitscript: bool, optional :param additional_content: Additional content to be put in an expander, defaults to None :type additional_content: str, optional

duHast.UI.Objects.file_item module

A class to store file information.

class duHast.UI.Objects.file_item.MyFileItem(name, size, bim360_project_guid=None, bim360_file_guid=None, bim360_revit_version='-', is_selected=False)

Bases: Base

Class constructor.

Parameters:
  • name (str) – The fully qualified file path.

  • size (int) – The file size.

  • bim360_project_guid (str, optional) – The BIM360 project GUID, defaults to None

  • bim360_file_guid (str, optional) – The BIM360 file GUID, defaults to None

  • bim360_revit_version (str, optional) – The revit file version (year only), defaults to ‘-’

duHast.UI.Objects.file_select_settings module

A class to store file select UI settings.

class duHast.UI.Objects.file_select_settings.FileSelectionSettings(input_path, include_sub_dirs_in_search, output_directory, output_file_number, revit_file_extension, filters, filter_type)

Bases: Base

Class constructor

Parameters:
  • inputDirectory (str) – A fully qualified directory path containing files to be shown in UI.

  • include_sub_dirs_in_search (bool) – If True include subdirectories in file search, otherwise just root directory.

  • output_directory (str) – A fully qualified directory path to where task files will be written.

  • output_file_number (int) – The number of task files to be written out.

  • revitFileExtension (str) – A file extension filter applied to directory search.

duHast.UI.Objects.workload_bucket module

A work load bucket.

Workload buckets are used to distribute file processing evenly between parallel running batch processor sessions based on Revit file size.

class duHast.UI.Objects.workload_bucket.WorkloadBucket

Bases: Base

Class constructor.

Initializes this class with:

  • .workload_value = 0

  • .items = []

set_workload_value(value)

Sets the buckets overall workload value.

Parameters:

value (int) – An integer representing the workload value of this bucket.

add_item(value)

Adds an item to the workload list.

Parameters:

value (foo) – Adds an item to the workload list.

Module contents