Sample Code Revit Batch Processor 1.1.14 documentation

Contents:

This Page

duHast.Revit.Family.Reporting package

Subpackages

Submodules

duHast.Revit.Family.Reporting.families_report_header module

Revit families report headers.

duHast.Revit.Family.Reporting.report module

Module containing reporting functions.

  • families

duHast.Revit.Family.Reporting.report.report_loaded_families(doc, parameter_names_filter=['Sample Parameter One', 'Sample Parameter Two', 'Sample Parameter Three'], progress_callback=None)

Reports on loaded families:

  • family name

  • family type

  • family category

  • specific family type parameters and their values

  • family instances placed by by type in model

Parameters:
  • doc (Autodesk.Revit.DB.Document) – Current Revit model document.

  • output (func(message)) – A function piping messages to designated target.

Returns:

Result class instance.

  • result.status False if an exception occurred, otherwise True.

  • result.message will contain processing messages.

  • result.result family data array

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.Family.Reporting.report_differences_in_reports module

Module containing comparison reporting of family reports.

This mimicks an outer join between any number of reports.

The reports are compared based on the family name, type name, parameter name:,

family Name, Type name, parmater name, report 1, report 2, report 3, … family 1, type 1, parameter 1, value 1, N/A, value 1, … family 2, type 2, parameter 2, N/A, value 2, value 3, … family 3, type 3, parameter 3, value 3, N?A N/A …

N/A = not available in that report

duHast.Revit.Family.Reporting.report_differences_in_reports.outer_join_report_a_vs_b(report_a, report_b)
duHast.Revit.Family.Reporting.report_differences_in_reports.compare_outer_join_result_with_report(report, outer_join_result)
duHast.Revit.Family.Reporting.report_differences_in_reports.read_report(file_path)
duHast.Revit.Family.Reporting.report_differences_in_reports.compare_family_reports_outer_join(file_paths)

duHast.Revit.Family.Reporting.report_fam_types_differences_from_XML module

Module containing comparison reporting of family types in a project vs in a library functions.

Reports:

  • if family does not exist in library

  • if type does not exist in library

  • if a parameter value for a given type is different to the parameter value for that type in the library

duHast.Revit.Family.Reporting.report_fam_types_differences_from_XML.get_family_type_data_from_project_file(doc, type_data_from_library, progress_callback=None)

Get the family type data from the families in the project file of families that are in the library only.

Parameters:
  • doc (Autodesk.Revit.DB.Document) – Revit document

  • type_data_from_library ([FamilyTypeDataStorageManager]) – list of family type data from the library

  • progress_callback (ProgressBase) – progress callback object

Returns:

Result class instance.

  • result.status: XML conversion status will be returned in result.status. False if an exception occurred, otherwise True.

  • result.message will contain which xml file was read and converted into family type data.

  • result.result will be [FamilyTypeDataStorageManager]

On exception

  • Reload.status (bool) will be False

  • Reload.message will contain the exception message

  • Reload.result will be an empty list

Return type:

Result

duHast.Revit.Family.Reporting.report_fam_types_differences_from_XML.build_comparison_report(type_data_matches, ignore_list_path)

Build a comparison report of the family type data from the project file against the library. Only differences are reported.

Parameters:
  • type_data_matches ([([FamilyTypeDataStorageManager], [FamilyTypeDataStorageManager])]) – list of matched family type data

  • ignore_list_path (str) – path to a csv file containing a list of families to ignore (name, category) in the comparison report.

Returns:

Result class instance.

  • result.status: Comparison status will be returned in result.status. False if an exception occurred, otherwise True.

  • result.message: will be empty.

  • result.result will be [[str]] where each entry is a list of family name, category etc and difference.

On exception

  • Reload.status (bool) will be False

  • Reload.message will contain the exception message

  • Reload.result will be an empty list

Return type:

Result

duHast.Revit.Family.Reporting.report_fam_types_differences_from_XML.compare_family_files_in_project_against_library(doc, process_directories, ignore_list_path=None, progress_callback=None)

Compare the family type data from the project file against the library. Only differences are reported.

Parameters:
  • doc (Autodesk.Revit.DB.Document) – Revit document

  • process_directories (list) – list of directories to search for xml files

  • ignore_list_path (str) – path to a csv file containing a list of families to ignore (name, category) in the comparison report.

  • progress_callback (ProgressBase) – progress callback object

Returns:

Result class instance.

  • result.status: Comparison status will be returned in result.status. False if an exception occurred, otherwise True.

  • result.message: Log entries.

  • result.result will be [[str]] where each entry is a list of family name, category etc and difference.

On exception

  • Reload.status (bool) will be False

  • Reload.message will contain the exception message

  • Reload.result will be an empty list

Return type:

Result

duHast.Revit.Family.Reporting.report_fam_types_from_XML module

Module containing reporting family type reporting functions.

Reports:

  • all family types in the library folder ( based on xml files located in the library folder)

duHast.Revit.Family.Reporting.report_fam_types_from_XML.build_report(type_data_storage_manager_instances)

Build a report of the family type data retrieved from the library.

Parameters:

type_data_storage_manager_instances ([FamilyTypeDataStorageManager]) – list of matched family type data

Returns:

Result class instance.

  • result.status: Comparison status will be returned in result.status. False if an exception occurred, otherwise True.

  • result.message: will be empty.

  • result.result will be [[str]] where each entry is a list of family name, category etc and difference.

On exception

  • Reload.status (bool) will be False

  • Reload.message will contain the exception message

  • Reload.result will be an empty list

Return type:

Result

duHast.Revit.Family.Reporting.report_fam_types_from_XML.get_family_type_data_from_library_xml(process_directories, progress_callback=None)

Reads family xml atom files from library directories and saves them out to a combined csv report.

Parameters:
  • process_directories (list) – list of directories to search for xml files

  • progress_callback (ProgressBase) – progress callback object

Returns:

Result class instance.

  • result.status: Report status will be returned in result.status. False if an exception occurred, otherwise True.

  • result.message: Log entries.

  • result.result will be [[str]] where each entry is a list of family name, category etc and difference.

On exception

  • Reload.status (bool) will be False

  • Reload.message will contain the exception message

  • Reload.result will be an empty list

Return type:

Result

duHast.Revit.Family.Reporting.report_fam_types_from_project_via_xml module

Module containing reporting of family types in a project functions.

Reports:

  • all family types and their type parameters values in a project

duHast.Revit.Family.Reporting.report_fam_types_from_project_via_xml.build_type_report(doc_name, type_data, ignore_list_path)
duHast.Revit.Family.Reporting.report_fam_types_from_project_via_xml.get_all_family_type_data_from_project_file(doc, ignore_list_path=None, progress_callback=None)

Get all family type data from the project file.

Parameters:
  • doc (Autodesk.Revit.DB.Document) – The Revit document.

  • ignore_list_path (str) – The path to the ignore list file. ( 2 columns csv file with family name and category name)

  • progress_callback (function) – The progress callback function.

Returns:

The family type data.

Return type:

list[FamilyTypeDataStorageManager]

Module contents