Sample Code Revit Batch Processor 1.1.16 documentation

Contents:

This Page

duHast pyRevit Extension

A pyRevit toolbar extension for Revit, providing automation tools for BIM workflows across family management, export, view management, model maintenance, and more.


Toolbar Panels

Panels and button groups are listed in ribbon order, matching the extension’s bundle layouts. Names are the labels shown in Revit.

About

Reference links. Neither button touches the model.

Button Group

Description

About

Open the extension licence on GitHub, or the Icons8 site the icons come from


Cloud

Tools for working with cloud-hosted Revit models.

Button Group

Description

GUIDS

Retrieve cloud project and model GUIDs for the model and all its links, for Revit Batch Processor task files


Grids And Levels

Tools for controlling grid bubble and level header visibility, and 2D/3D extent behaviour, in the active view.

Button Group

Description

Grids

Show or toggle grid bubbles at either end, switch grids to 2D, extend grids to the view crop, propagate grid setup to other plan views

Levels

Show or toggle level headers at either end, switch levels to 2D


View Templates

Tools for propagating and transferring view template settings, filters and colour schemes.

Button Group

Description

Modify

Propagate filter and category overrides from a source view template to many others; delete filters from templates

Import Export

Export and import view template overrides and view filters as JSON, and colour fill scheme values as CSV


Views

Tools for managing Revit schedules on sheets and in views.

Button Group

Description

Schedules

Manage column widths; report and fix schedule segment overlaps on sheets; export, extract and import Room: Number filter values


Purge Unused

Tools to remove unused elements from the model. Every tool asks what to remove before deleting anything.

Button Group

Description

Purge

Purge unused line styles, fill patterns, line patterns, shared parameters, filters, legends, schedules, view templates and unplaced views


Warnings

Tools for resolving and locating common Revit warnings on rooms, areas and annotation.

Button Group

Description

Solve Warnings

Fix room tags outside rooms, duplicate marks, and overlapping area or room separation lines

Highlight Warnings

Report area and room separation lines carrying warnings, and colour-highlight them in the active view


Families

Tools for loading, saving, renaming, swapping and reporting on Revit families and type catalogue files.

Button Group

Description

Reload

Reload families from a library folder, with match-status filtering

Rename

Rename loaded families and types, or rename .rfa files in a library folder, from a CSV

IO

Load families from a folder into the project, or save loaded families out to a folder

CatalogueFiles

Export and clean type catalogue files; strip a family back to a single catalogue placeholder type

Force Update

Force Revit to detect a family as changed when source files have been overwritten

Change Category

Reassign the open family to a different Revit category, preserving subcategories

Reports

Report on and compare family libraries and projects, via XML part atom exports

SwapFamilies

Replace family instances with a different type, by CSV directive folder, selection or picking

At The Library

Open the AtTheLibrary tool for managing shared type catalogue parameters


Ceilings

Button Group

Description

Ceilings By Room

Create a ceiling matching the boundary of each selected room


Walls

Tools that relate walls and facade openings back to the rooms they bound.

Button Group

Description

Walls By Room

Write the room number onto the walls bounding each selected room

Facade Opening To Room

Report external wall and window opening areas per room to CSV


PushIt

Tools for managing mock rooms — room-like families that carry room data — and the data pushed into them.

Button Group

Description

Push It!

Open the PushIt application for loading room data and pushing it into mock rooms

Get A Room!

Build mock room families from filled regions; set the family output directory

Swap Width And Depth

Swap the width and depth values on picked mock rooms and rotate them 90 degrees

Stats

Report mock room counts by family, creator and owner; flag IDs duplicated across design sets

Place Revit Rooms

Create native Revit rooms at the locations of mock rooms, read from this model or a link

Verify Push It Area

Measure mock rooms with temporary Revit rooms and write the area back onto them


Export

Tools for exporting sheets, checking exports, and syncing document data.

Button Group

Description

PDF and DWG

Export sheets to PDF and/or DWG with configurable naming rules and print sets

Compare

Check the sheets in a Revit schedule against the PDF files in a folder

docManager

Sync sheets and revisions from the model to a Document Manager database; configure document numbering


Data

Scripts for exporting model data to file for reporting and audit purposes.

Button Group

Description

Collectors

Export rooms, spaces, sheets, ceilings, floors, doors, levels and placed items to JSON — from the active model and its Revit links


RoomMate

Integration with a local RoomMate server.

Button Group

Description

Export

Push room and door data from the model and its links to a local RoomMate server


Getting Started

  1. Install pyRevit if not already installed.

  2. Copy the extension folder to your pyRevit extensions directory, or add it via pyRevit settings.

  3. Restart Revit — the duHast tab will appear in the ribbon.

  4. Refer to the individual docs linked above for prerequisites and configuration before first use.

Before you run a tool

Three things decide whether a button will work at all. Each doc repeats the ones that apply to it, but they are worth knowing up front.

Some tools only run on a family open in the Family Editor. They exit with “This is not a family document.” if run from a project: Change Category, Force Update and all three Catalogue Files tools.

Some tools store their settings in the Revit model and refuse to start until a Settings button has been run on that model: PDF/DWG Export, docManager and Get A Room!. Settings are held in an extensible schema, so they travel with the file but do not travel between files.

Some tools open a .NET window loaded from the extension’s bin folder at run time. If that folder is missing or incomplete the button fails immediately with a message about the bin directory. This applies to Push It!, At The Library, Reload, PDF/DWG Export and docManager.

A few tools are also driven by constants edited in the extension’s lib folder rather than by a dialog — see Facade Opening To Room, Ceilings By Room and Reports.

Requirements

  • Revit 2025 or later — the extension declares min_revit_ver: 2025, with engines configured for 2025 and 2026.

  • pyRevit (latest stable version recommended).

  • duHast Python library — bundled in the extension under lib/duHast.

  • The extension’s bin folder, for the tools that open a .NET window.