Sample Code Revit Batch Processor 1.1.11 documentation

Contents:

This Page

duHast.Data.Utils package

Submodules

duHast.Data.Utils.collectors_to_blueprints module

Utility functions converting collector objects to blueprint objects.

duHast.Data.Utils.collectors_to_blueprints.sheets_group_by_instance_property(sheet_data, property_name)

Groups sheets by a given property

Parameters:
  • sheet_data ([:class: .DataSheet]) – A list od DataSheet instances

  • property_name (str) – The name of the sheet instance property by its value to group the sheets by

Raises:
  • ValueError – property_name needs to be of type str

  • ValueError – sheet_data needs to be of type list

  • ValueError – sheet got multiple properties of the given name

  • ValueError – sheet no properties of the given name

  • ValueError – sheet_data list contained a none DataSheet object

Returns:

Result class instance.
  • .status True if sheets where grouped successfully, otherwise False.

  • .message will be empty.

  • . result (a list with the grouped sheets as a dictionary)

on exception:

  • .result Will be False

  • .message will contain exception message.

  • . result (empty list)

rtype:

Result

duHast.Data.Utils.data_export module

duHast.Data.Utils.data_import module

duHast.Data.Utils.data_to_file module

Utility functions writing data objects to file.

duHast.Data.Utils.data_to_file.build_json_for_file(dic, model_name)

Adds two header keys to json output to be saved to file.

  • file name

  • date processed

Parameters:
  • dic ({str:[]}) – A dictionary containing all data items. Key is the data tpe, value the data objects

  • model_name (str) – The revit model name.

Returns:

A dictionary

Return type:

{str:[]}

Module contents