Sample Code Revit Batch Processor 1.1.11 documentation

Contents:

This Page

duHast.Revit.Categories.Data package

Subpackages

Submodules

duHast.Revit.Categories.Data.category_data_purge_unused module

Family category purge unused utilities.

This will delete all subcategories which are user created ( id greater then 0) and are not used by any element in the family or nested families.

  • requires a revit category processor object

duHast.Revit.Categories.Data.category_data_purge_unused.purge_unused_sub_categories(doc, processor)

This function deletes all user-created subcategories (with IDs greater than 0) that are not used by any element in the family or nested families.

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

  • processor (CategoryProcessor) – A CategoryProcessor object containing all subcategory information of the family document and any nested families.

Returns:

Result class instance. - result.status (bool): True if all unused subcategories were deleted successfully or none needed to be deleted, otherwise False. - result.message (str): Property updated in the format: “Found unused subcategory: family category Name : subcategory Name [subcategory Id]”

On exception:
  • status (bool): False.

  • message (str): Contains the exception message.

Return type:

Result

Module contents