Revit-CLI

Revit-CLI vs writing C# against the Revit API

Automating Revit directly means writing C# add-ins against RevitAPI.dll for every task, while the alternative is repeating clicks in the viewport. Revit-CLI implements the Revit API plumbing once via a user-space add-in and named pipe: 34 verbs with plain flags, JSON output, UniqueId addressing and dry-run safety until --apply.

34 verbs · Zero redistributed Autodesk DLLs · 10 tasks compared below

TaskRevit GUI, by handRaw C# Revit API Revit-CLI
Check .rvt year, build & worksharingLaunch Revit, wait for splash, open File > Info or guess from errorsReference RevitAPI or write a custom OLE structured storage parserrvt file-info model.rvt (Ring 0, instant, no Revit needed)
Audit active model warningsManage > Warnings, expand groups manually, copy-paste to notesCompile IExternalCommand, call doc.GetWarnings(), group & format JSONrvt warnings (grouped by severity & cause, <= 9 KB JSON)
List elements & read parametersFilter schedules or click elements one by one in PropertiesWrite FilteredElementCollector, resolve BuiltInCategory, serialize Parameterrvt elements --category Walls + rvt params --id <UniqueId>
Update parameter safely with previewEdit in Properties, undo manually if wrongOpen Transaction, handle FailuresPreprocessor, roll back or commitrvt param-set --id <UID> --param Mark --value W1 (dry-run by default; --apply commits)
Create sheets & place viewportsNew Sheet > pick titleblock > drag view onto sheet > alignFind FamilySymbol titleblock, ViewSheet.Create, Viewport.Creatervt sheet-create + rvt view-place --sheet A101 --view "Level 1" --apply
Export schedule to CSVOpen schedule > File > Export > Reports > Schedule > pick delimiterLocate ViewSchedule, configure ViewScheduleExportOptions, call Exportrvt schedule-export --schedule "Door Schedule" --out doors.csv
Export PDF / IFC / DWG in backgroundOpen model in UI, wait for views, configure Export dialogWire ExternalEvent, PDFExportOptions/IFCExportOptions/DWGExportOptionsrvt export --format pdf --out out.pdf --file model.rvt --headless
Cascading purge of unused elementsManage > Purge Unused > repeat Check All 3-5 times manuallyCall GetUnusedElements in a loop across passes inside a Transactionrvt purge --passes 5 (dry-run preview first, --apply commits)
Run model QA rules checkInspect warnings, unplaced rooms, titleblocks and empty params separatelyWrite multiple collectors, room area checks, parameter validatorsrvt rules-check (single JSON report of warnings, rooms, params & sheets)
Generate native .rvt from JSON specModel levels, grids, walls, slabs and openings manuallyWrite 600+ lines of Level.Create, Wall.Create, Floor.Create, NewOpeningrvt building-build spec.json --apply --out model.rvt

The repetitive cost in raw C# is the plumbing: .addin registration, ExternalEvent dispatching, modal dialog suppression, Transaction rollback, and bounded JSON output. Paying that once in one CLI gives every script and AI agent a uniform JSON surface.

Common questions

Why use Revit-CLI instead of writing a custom C# add-in for each task?

Writing raw C# against the Revit API requires a .addin manifest, ExternalEvent marshaling for pipe/async calls, FailuresProcessing dialog guards, Transaction rollback handling, and UniqueId resolution for every script. Revit-CLI packages all 34 verbs once behind a uniform JSON contract.

Can Revit-CLI run unattended without keeping Revit open on screen?

Yes. Pass --file PATH --headless to any Ring 1B/1C verb: rvt launches minimized Revit 2027, opens the background document via OpenDocumentFile, executes the command, and closes cleanly.

Run these verbs on your own Revit 2027 models

Run read-only inspection on any .rvt model before changing a single parameter. Revit-CLI is local and on-premise: zero UAC elevation, zero Autodesk DLLs redistributed, and every write is a dry run until you pass --apply. Fourteen-day free trial with e-mail only, no card.

Start a 14-day free trial

Verb families