Skip to main content

Execution Overview

Use Execution when you want to run automation code inside the host without a slow rebuild/restart loop.

Execution has two main user-facing paths:

PathUse when
ScriptingYou want quick iteration from source files without creating a full add-in project
.NET AssemblyYou want to run compiled commands from an add-in/tool assembly

Capability Table​

This table is the source of truth for what each runtime supports today.

RuntimeEntry suffixDebuggerPackages / referencesHosts
CPython*script.pyYes — debugpy attach (default port 5678)Pixi (conda-forge + PyPI) default; pip / pyRevit cengines fallback. uv sidecar only on Plant 3D — an AutoCAD-family exception where the host already embeds CPython; not a separate claimed hostRevit, AutoCAD-family (Pixi 3.14). Plant 3D uses host attach + uv sidecar — see Modern Python Scripting
IronPython*_ipy_script.pyNo attachNo PEP 723 / package managerRevit + AutoCAD-family
C# script*script.csxYes — attach to host process (VS / VS Code)#r "nuget: …" via NuGet resolverRevit + AutoCAD-family
F# script*script.fsxYes — attach to host process (VS / VS Code)#r "nuget: …"; cache %APPDATA%\RevitDevTool\nugetRevit + AutoCAD-family
.NET assembly.dllYes — attach to host process (VS / VS Code)Compiled referencesRevit + AutoCAD-family

IronPython engine selection​

HostEngine
RevitpyRevit engine first when pyRevit is loaded (default IronPython 2.7.12); embedded IronPython 3.4.2 fallback
AutoCAD-familyBundled IronPython 3.4.2 (no pyRevit)

IronPython execution and IronPython pytest routing (test_*_ipy.py) share the same Revit engine preference.

Folder Rules​

A folder is visible as a script command only if it contains at least one supported entry file:

*script.py
*_ipy_script.py
*script.csx
*script.fsx

Build output, package folders, virtual environments, docs, and tooling folders are ignored.

Choose The Right Mode​

NeedRecommended mode
Explore model data quicklyCPython scripting
Use pandas/polars/numpy/shapely-style packagesCPython scripting
Debug Python with VS CodeCPython scripting — Debugging
Reuse IronPython or pyRevit-style codeIronPython scripting
Try a small typed snippetC# script — C# Scripts
Prototype with F# interactive-style codeF# script — F# Scripts
Run compiled commands without Add-In Manager.NET assembly
Build a production add-in command.NET assembly

Host Context Reminder​

Host API calls must happen in valid host API context. Commands launched through RevitDevTool are designed for that workflow. Background/modeless UI code still needs to route host API work back through the supported host execution path.

More Pages​