Sample Code Revit Batch Processor 1.1.11 documentation

Contents:

This Page

duHast.Revit.Categories.Reporting package

Submodules

duHast.Revit.Categories.Reporting.categories_report_header module

Revit category report headers.

duHast.Revit.Categories.Reporting.categories_report_utils module

Revit category report functions .

duHast.Revit.Categories.Reporting.categories_report_utils.build_report_data_by_category(doc, dic, family_cat, main_cat_name, doc_file_path)

Formats category properties into lists for reports :param doc: Current Revit family document. :type doc: Autodesk.Revit.DB.Document :param dic: dictionary containing category properties :type dic: _type_ :param family_cat: The family category name. :type family_cat: str :param main_cat_name: A hard coded revit category name. Can be the same as familyCat. :type main_cat_name: str :param doc_file_path: The fully qualified family file path. :type doc_file_path: str :return: A list of list of strings. Each row represents one category. :rtype: list[list[str]]

duHast.Revit.Categories.Reporting.categories_report_utils.get_report_data(doc, revit_file_path)

Reports all categories, their properties and all elements belonging to them. :param doc: Current Revit family document. :type doc: Autodesk.Revit.DB.Document :param revit_file_path: The fully qualified family file path. :type revit_file_path: str :return: A list of list of strings. Each row represents one category. :rtype: list[list[str]]

duHast.Revit.Categories.Reporting.categories_styles_model_io module

This module contains the Revit category report files IO functionality.

duHast.Revit.Categories.Reporting.categories_styles_model_io.write_category_graphics_settings_report(revit_file_name, file_path, data)

Write category graphic settings to file.

Parameters:
  • revit_file_name (str) – The revit file name (without path or file extension)

  • file_path (str) – Fully qualified file path

  • data ({str:Any}) – json dictionary to be written to file

Returns:

Result class instance.

  • result.status False if file failed to write, otherwise True.

  • result.message will contain file name of file written.

  • result.result: empty list

On exception:

  • result.status (bool) will be False.

  • result.message will contain the exception message.

  • result.result: will be an empty list

Return type:

Result

duHast.Revit.Categories.Reporting.categories_styles_model_io.read_category_graphics_data_from_file(file_path)

Reads a category graphics data report file into a list of ObjectStyle instances

Parameters:

file_path (str) – Fully qualified file path of report file.

Raises:

ValueError – If data node is missing from file

Returns:

list of settings if files was read successfully otherwise an exception will be raised.

Return type:

[ObjectStyle]

duHast.Revit.Categories.Reporting.categories_styles_model_json_props module

This module contains node names for categories style reports in json format.

Module contents