Upgrade Revit Macros

If you are upgrading Macros, some file management may be required to update and operate macros correctly in Revit.

Be sure to familiarize yourself with changes in the Revit Software Development Kit (SDK) and the following macros upgrade information.

Upgrading Application-Level Macros

  1. Copy and paste macros directories into:
    • Windows 7 and Windows 8: %ProgramData%\Autodesk\Revit\Macros\2025 Release\Revit\AppHookup
  2. Locate .csproj and make the following change:
    • Change "<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>" to "<TargetFramework>net7.0-windows</TargetFramework>".
The following is an example of a new macro project.
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net8.0-windows</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
    <PlatformTarget>x64</PlatformTarget>
    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
    <AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
    <Optimize>False</Optimize>
    <DebugSymbols>True</DebugSymbols>
    <DebugType>Portable</DebugType>
    <OutputPath>..\..\Addin\</OutputPath>
    <AssemblyName>MacroTemplate</AssemblyName>
    <BaseInterMediateOutputPath>obj\</BaseInterMediateOutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <InterMediateOutputPath>obj\Debug</InterMediateOutputPath>
    <Deterministic>false</Deterministic>
    <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
    <GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
    <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
    <GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
    <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
    <GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="..\..\..\..\..\RevitAPI.dll">
      <Private>False</Private>
    </Reference>
    <Reference Include="..\..\..\..\..\RevitAPIUI.dll">
      <Private>False</Private>
    </Reference>
  </ItemGroup>
  <Target Name="PreBuild" BeforeTargets="PreBuildEvent">
    <Exec Command="del $(OutputPath)\*.dll" />
  </Target>
</Project>

Upgrading Document-Level Macros

  1. Document Level macros are not supported in Revit 2025. You will need to convert document level macros to application level macros manually.
  2. Use a previous version Revit to open document, and copy document macro project to application macro folder.
  3. Update the .csproj file.
  4. Change file names. "ThisDocument.cs" to "ThisApplication.cs", "ThisDocument.Designer.cs" to "ThisApplication.Designer.cs".
  5. Change class name from "ThisDocument" to "ThisApplication" in .cs files.
  6. Change superclass name from "Autodesk.Revit.UI.Macros.DocumentEntryPoint" to "Autodesk.Revit.UI.Macros.ApplicationEntryPoint" in ThisApplication.Designer.cs.
Note: The upgraded macros in Revit 2025 will not be automatically loaded if Revit is already running. To load the upgraded macros, you will need to restart Revit.