API surface changes across Revit 2022–2026 that affect bim revit exec snippets. Check here before assuming a member exists — and use bim revit api search to verify against your installed version.
If your snippet needs to run on both old and new versions, use bim revit api describe "P:Autodesk.Revit.DB.ElementId.Value" to check availability.
ProjectPosition (latitude/longitude)
Revit version
Notes
2022–2024
doc.ActiveProjectLocation.GetProjectPosition(...).Latitude works
2025
Latitude and Longitude removed from ProjectPosition; use doc.SiteLocation or the SiteLocation.Latitude/Longitude API instead
Transaction API
Pattern
Notes
Auto-transaction (default)
bim revit exec wraps your snippet in a Transaction automatically. Safe for write operations.
--no-transaction
Required when: setting uidoc.ActiveView, calling doc.Regenerate() standalone, or managing your own nested transactions.
uidoc.ActiveView = view
Throws InvalidOperationException inside the auto-transaction. Fix: add --no-transaction to the exec call.
PDF export
Revit version
Notes
2022+
doc.Export(folder, PDFExportOptions, IList<ElementId> viewIds) available. PDFExportOptions.CombinedFile = false = one PDF per view.
All versions
Write the export loop in an exec snippet using doc.Export(folder, options, viewIds), or use --file for longer scripts.
.NET target by Revit year
Revit
.NET target
TCP port
2022, 2023
net48 (.NET Framework 4.8)
14700, 14701
2024
net48 (.NET Framework 4.8)
14702
2025, 2026
net8.0-windows (.NET 8)
14703, 14704
2027
net10.0-windows (.NET 10)
14705
The add-in is compiled per year — use bim revit install --revit-version <year> when targeting a specific version. A version mismatch causes the TCP bridge to fail silently at startup; bim revit status --detailed reports it.
Diagnosing version issues
# check add-in version, port state, and installation
bim revit status --detailed
# search API availability for your installed version
bim revit api search "ProjectPosition"
bim revit api type "Autodesk.Revit.DB.ProjectPosition"