Skip to content

Scripting editor for fsharp in Revit

License

Notifications You must be signed in to change notification settings

goswinr/Fesh.Revit

Repository files navigation

Logo

Fesh.Revit

code size license

Fesh.Revit is an F# scripting editor hosted inside Revit. It is based on Fesh.
It has semantic syntax highlighting, auto completion, type info tooltips and more.
The output window supports colored text.

The example script in the root folder generates the axes for cladding of the Louvre Abu Dhabi.
See also my talk at FSharpConf 2016

How to build

To build use the .NET SDK via the command line.
You need to use pass in your Revit version as an argument like this:

dotnet build -p:RevitVersion=2024

This will find and compile Fesh.Revit.fsproj since it is the only *.fsproj file in the root folder.
It will automatically create an Fesh.addin xml file for the specified Revit version
in the Revit Addins folder at C:/ProgramData/Autodesk/Revit/Addins/20XX/Fesh.addin.

How to use F# with Revit

By default a f# script evaluation starts asynchronous on a new thread. The Fesh.Revit.dll also provides utility functions to run synchronous transaction on the current document or app instance:

Fesh.Revit.ScriptingSyntax.runApp (fun (app:UIApplication)  -> ...)

License

MIT