Sample Code Revit Batch Processor 1.1.11 documentation

Contents:

This Page

duHast.Revit.Family.Utility package

Submodules

duHast.Revit.Family.Utility.loadable_family_categories module

This module contains a number of lists containing loadable family categories.

duHast.Revit.Family.Utility.loadable_family_categories.CATEGORIES_LOADABLE_3D = [Autodesk.Revit.DB.BuiltInCategory.OST_Casework, Autodesk.Revit.DB.BuiltInCategory.OST_Columns, Autodesk.Revit.DB.BuiltInCategory.OST_CommunicationDevices, Autodesk.Revit.DB.BuiltInCategory.OST_DataDevices, Autodesk.Revit.DB.BuiltInCategory.OST_Doors, Autodesk.Revit.DB.BuiltInCategory.OST_ElectricalEquipment, Autodesk.Revit.DB.BuiltInCategory.OST_ElectricalFixtures, Autodesk.Revit.DB.BuiltInCategory.OST_Entourage, Autodesk.Revit.DB.BuiltInCategory.OST_FireAlarmDevices, Autodesk.Revit.DB.BuiltInCategory.OST_Furniture, Autodesk.Revit.DB.BuiltInCategory.OST_FurnitureSystems, Autodesk.Revit.DB.BuiltInCategory.OST_GenericModel, Autodesk.Revit.DB.BuiltInCategory.OST_LightingFixtures, Autodesk.Revit.DB.BuiltInCategory.OST_LightingDevices, Autodesk.Revit.DB.BuiltInCategory.OST_MechanicalEquipment, Autodesk.Revit.DB.BuiltInCategory.OST_NurseCallDevices, Autodesk.Revit.DB.BuiltInCategory.OST_Parking, Autodesk.Revit.DB.BuiltInCategory.OST_Planting, Autodesk.Revit.DB.BuiltInCategory.OST_PlumbingFixtures, Autodesk.Revit.DB.BuiltInCategory.OST_SecurityDevices, Autodesk.Revit.DB.BuiltInCategory.OST_Site, Autodesk.Revit.DB.BuiltInCategory.OST_SpecialityEquipment, Autodesk.Revit.DB.BuiltInCategory.OST_Sprinklers, Autodesk.Revit.DB.BuiltInCategory.OST_StructuralColumns, Autodesk.Revit.DB.BuiltInCategory.OST_StructuralFoundation, Autodesk.Revit.DB.BuiltInCategory.OST_StructuralFraming, Autodesk.Revit.DB.BuiltInCategory.OST_TitleBlocks, Autodesk.Revit.DB.BuiltInCategory.OST_TelephoneDevices, Autodesk.Revit.DB.BuiltInCategory.OST_Windows]

This list contains 3D element categories and is used in obsolete revit family purge function any revit category commented out with note ‘purged else where’ can be found in list ‘catsLoadableThreeDOther’

duHast.Revit.Family.Utility.loadable_family_categories.CATEGORIES_LOADABLE_3D_OTHER = [Autodesk.Revit.DB.BuiltInCategory.OST_CableTrayFitting, Autodesk.Revit.DB.BuiltInCategory.OST_ConduitFitting, Autodesk.Revit.DB.BuiltInCategory.OST_CurtainWallPanels, Autodesk.Revit.DB.BuiltInCategory.OST_DetailComponents, Autodesk.Revit.DB.BuiltInCategory.OST_DuctAccessory, Autodesk.Revit.DB.BuiltInCategory.OST_DuctTerminal, Autodesk.Revit.DB.BuiltInCategory.OST_DuctFitting, Autodesk.Revit.DB.BuiltInCategory.OST_PipeAccessory, Autodesk.Revit.DB.BuiltInCategory.OST_PipeFitting, Autodesk.Revit.DB.BuiltInCategory.OST_ProfileFamilies, Autodesk.Revit.DB.BuiltInCategory.OST_StairsRailingBaluster]

Contains 3D family categories which needed specific purge code, rather then checking for unplaced family instances. i.e. built in revit type settings

duHast.Revit.Family.Utility.loadable_family_categories.CATEGORIES_LOADABLE_TAGS = [Autodesk.Revit.DB.BuiltInCategory.OST_CurtainWallPanelTags, Autodesk.Revit.DB.BuiltInCategory.OST_AreaTags, Autodesk.Revit.DB.BuiltInCategory.OST_CaseworkTags, Autodesk.Revit.DB.BuiltInCategory.OST_CeilingTags, Autodesk.Revit.DB.BuiltInCategory.OST_DataDeviceTags, Autodesk.Revit.DB.BuiltInCategory.OST_DetailComponentTags, Autodesk.Revit.DB.BuiltInCategory.OST_DoorTags, Autodesk.Revit.DB.BuiltInCategory.OST_DuctAccessoryTags, Autodesk.Revit.DB.BuiltInCategory.OST_DuctFittingTags, Autodesk.Revit.DB.BuiltInCategory.OST_DuctInsulationsTags, Autodesk.Revit.DB.BuiltInCategory.OST_DuctLiningsTags, Autodesk.Revit.DB.BuiltInCategory.OST_DuctTags, Autodesk.Revit.DB.BuiltInCategory.OST_DuctTerminalTags, Autodesk.Revit.DB.BuiltInCategory.OST_ElectricalCircuitTags, Autodesk.Revit.DB.BuiltInCategory.OST_ElectricalEquipmentTags, Autodesk.Revit.DB.BuiltInCategory.OST_ElectricalFixtureTags, Autodesk.Revit.DB.BuiltInCategory.OST_FabricAreaTags, Autodesk.Revit.DB.BuiltInCategory.OST_FabricReinforcementTags, Autodesk.Revit.DB.BuiltInCategory.OST_FireAlarmDeviceTags, Autodesk.Revit.DB.BuiltInCategory.OST_FlexDuctTags, Autodesk.Revit.DB.BuiltInCategory.OST_FlexPipeTags, Autodesk.Revit.DB.BuiltInCategory.OST_FloorTags, Autodesk.Revit.DB.BuiltInCategory.OST_FoundationSlabAnalyticalTags, Autodesk.Revit.DB.BuiltInCategory.OST_FurnitureTags, Autodesk.Revit.DB.BuiltInCategory.OST_FurnitureSystemTags, Autodesk.Revit.DB.BuiltInCategory.OST_GenericModelTags, Autodesk.Revit.DB.BuiltInCategory.OST_InternalAreaLoadTags, Autodesk.Revit.DB.BuiltInCategory.OST_InternalLineLoadTags, Autodesk.Revit.DB.BuiltInCategory.OST_InternalPointLoadTags, Autodesk.Revit.DB.BuiltInCategory.OST_IsolatedFoundationAnalyticalTags, Autodesk.Revit.DB.BuiltInCategory.OST_KeynoteTags, Autodesk.Revit.DB.BuiltInCategory.OST_LightingDeviceTags, Autodesk.Revit.DB.BuiltInCategory.OST_LightingFixtureTags, Autodesk.Revit.DB.BuiltInCategory.OST_LineLoadTags, Autodesk.Revit.DB.BuiltInCategory.OST_LinkAnalyticalTags, Autodesk.Revit.DB.BuiltInCategory.OST_MassTags, Autodesk.Revit.DB.BuiltInCategory.OST_MaterialTags, Autodesk.Revit.DB.BuiltInCategory.OST_MechanicalEquipmentTags, Autodesk.Revit.DB.BuiltInCategory.OST_MEPSpaceTags, Autodesk.Revit.DB.BuiltInCategory.OST_MultiCategoryTags, Autodesk.Revit.DB.BuiltInCategory.OST_NodeAnalyticalTags, Autodesk.Revit.DB.BuiltInCategory.OST_NurseCallDeviceTags, Autodesk.Revit.DB.BuiltInCategory.OST_ParkingTags, Autodesk.Revit.DB.BuiltInCategory.OST_PartTags, Autodesk.Revit.DB.BuiltInCategory.OST_PathReinTags, Autodesk.Revit.DB.BuiltInCategory.OST_PipeAccessoryTags, Autodesk.Revit.DB.BuiltInCategory.OST_PipeFittingTags, Autodesk.Revit.DB.BuiltInCategory.OST_PipeInsulationsTags, Autodesk.Revit.DB.BuiltInCategory.OST_PipeTags, Autodesk.Revit.DB.BuiltInCategory.OST_PlantingTags, Autodesk.Revit.DB.BuiltInCategory.OST_PlumbingFixtureTags, Autodesk.Revit.DB.BuiltInCategory.OST_RailingSystemTags, Autodesk.Revit.DB.BuiltInCategory.OST_RebarTags, Autodesk.Revit.DB.BuiltInCategory.OST_RevisionCloudTags, Autodesk.Revit.DB.BuiltInCategory.OST_RoofTags, Autodesk.Revit.DB.BuiltInCategory.OST_RoomTags, Autodesk.Revit.DB.BuiltInCategory.OST_SecurityDeviceTags, Autodesk.Revit.DB.BuiltInCategory.OST_SitePropertyLineSegmentTags, Autodesk.Revit.DB.BuiltInCategory.OST_SitePropertyTags, Autodesk.Revit.DB.BuiltInCategory.OST_SpecialityEquipmentTags, Autodesk.Revit.DB.BuiltInCategory.OST_SprinklerTags, Autodesk.Revit.DB.BuiltInCategory.OST_StairsLandingTags, Autodesk.Revit.DB.BuiltInCategory.OST_StairsRailingTags, Autodesk.Revit.DB.BuiltInCategory.OST_StairsRunTags, Autodesk.Revit.DB.BuiltInCategory.OST_StairsSupportTags, Autodesk.Revit.DB.BuiltInCategory.OST_StairsTags, Autodesk.Revit.DB.BuiltInCategory.OST_StairsTriserTags, Autodesk.Revit.DB.BuiltInCategory.OST_StructConnectionTags, Autodesk.Revit.DB.BuiltInCategory.OST_StructuralColumnTags, Autodesk.Revit.DB.BuiltInCategory.OST_StructuralFoundationTags, Autodesk.Revit.DB.BuiltInCategory.OST_StructuralFramingTags, Autodesk.Revit.DB.BuiltInCategory.OST_StructuralStiffenerTags, Autodesk.Revit.DB.BuiltInCategory.OST_TelephoneDeviceTags, Autodesk.Revit.DB.BuiltInCategory.OST_TrussTags, Autodesk.Revit.DB.BuiltInCategory.OST_WallTags, Autodesk.Revit.DB.BuiltInCategory.OST_WindowTags]

This list contains 2D element categories and is used in obsolete revit family purge function.any revit category commented out with note ‘purged else where’ can be found in list ‘catsLoadableTagsOther’

duHast.Revit.Family.Utility.loadable_family_categories.CATEGORIES_LOADABLE_TAGS_OTHER = [Autodesk.Revit.DB.BuiltInCategory.OST_CalloutHeads, Autodesk.Revit.DB.BuiltInCategory.OST_ElevationMarks, Autodesk.Revit.DB.BuiltInCategory.OST_GenericAnnotation, Autodesk.Revit.DB.BuiltInCategory.OST_GridHeads, Autodesk.Revit.DB.BuiltInCategory.OST_LevelHeads, Autodesk.Revit.DB.BuiltInCategory.OST_ReferenceViewerSymbol, Autodesk.Revit.DB.BuiltInCategory.OST_SectionHeads, Autodesk.Revit.DB.BuiltInCategory.OST_SpotElevSymbols, Autodesk.Revit.DB.BuiltInCategory.OST_ViewportLabel]

Contains 2D family categories which needed specific purge code, rather then checking for unplaced family instances i.e. built in revit type settings

duHast.Revit.Family.Utility.xml_family_type_reader module

A module with helper function to read xml family type data into storage objects.

Separate module for ease of testing and maintainability.

duHast.Revit.Family.Utility.xml_family_type_reader.read_xml_file(file_path)

Read xml data from a file into a XmlDocument object.

Parameters:

file_path (str) – The path to the file.

Returns:

The data read back from the XML file.

Return type:

XmlDocument or None if an error occurred.

duHast.Revit.Family.Utility.xml_family_type_reader.read_xml_into_storage(doc_xml, family_name, family_path)

Read the XML data into the storage object.

Parameters:
  • doc_xml (XmlDocument) – The XML document.

  • family_name (str) – The name of the family.

  • family_path (str) – The path of the family file.

Returns:

A list of family type data objects.

Return type:

list[FamilyTypeDataStorage]

Module contents