Skip to content

Execution Scripts

Truong Giang Vu edited this page May 31, 2026 · 1 revision

Scripting Runtimes

Use scripting when you want to run source files directly without creating a compiled add-in project.

Execution scripting currently supports Python 3.13, IronPython, F# scripts, and C# scripts. Python 3.13 has its own page because it includes modern package workflows, PythonNet interop, debugger support, and richer samples.

Supported Script Entries

Script type Entry suffix Best use case
Python 3.13 *script.py Modern Python with PythonNet, packages, debugger support, and samples
IronPython *_ipy_script.py IronPython scripts, including existing pyRevit/RevitPythonShell-style code
F# script *script.fsx F# scripting and functional experiments
C# script *script.csx Quick typed C# experiments

Python 3.13

Python 3.13 scripting is the modern Python path in RevitDevTool. It uses PythonNet for .NET interop and supports package metadata, environment preparation, debugger attach, and the current Python sample set.

Use it for:

  • data analysis and reporting;
  • package-heavy automation;
  • VSCode debugging;
  • computational geometry or research scripts;
  • AI/ML experiments that need modern Python packages.

For details, see Modern Python Scripting.

IronPython

IronPython is a first-class script mode in RevitDevTool. pyRevit runtime support is also treated as a first-class path when available; when it is not available, RevitDevTool falls back to IronPython 3.4.2.

Key behavior:

  • uses pyRevit runtime support when available;
  • falls back to IronPython 3.4.2 when pyRevit is not available;
  • supports existing pyRevit/RevitPythonShell-style scripts;
  • is useful when direct IronPython/.NET behavior is preferable to CPython/PythonNet.

Entry example:

my_tool_ipy_script.py

For runtime choice guidance, see Python Ecosystems.

C# Scripts

C# scripts are useful when you want a short C# snippet but do not want to create a full add-in project.

Entry example:

Samples/CSharpScriptDemo/main_script.csx

The C# script pipeline is useful for quick host experiments without creating a full compiled add-in project.

For a better VSCode editing experience, install C# Dev Kit.

F# Scripts

F# scripts are useful for quick experiments, especially when you prefer F# syntax and interactive-style scripting.

Entry examples:

Samples/FSharpScriptDemo/main_script.fsx
Samples/FSharpScriptDemo/selection_script.fsx

F# NuGet resolution uses a custom cache under:

%APPDATA%\RevitDevTool\nuget

For a better VSCode editing experience, install Ionide for F#.

Caveats

  • net48 compatibility matters for Autodesk 2022-2024.
  • Host APIs still require host context.
  • F# and C# script support is newer than the Python 3.13 path.
  • Use focused host validation for non-trivial scripts.

Clone this wiki locally