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 Document-Level Macros

  1. Open the project containing embedded document-level macros. Once opened, the project has been updated.
  2. Click Manage tabMacros panel Macro Manager.
  3. Click each Document-level tab to update.
  4. When complete, click Close.
  5. Save and close the project.

No further steps are required unless the macro code needs to be manually edited.

Upgrading Application-Level Macros

  1. Copy and paste macros directories into:
    • Windows 7 and Windows 8: %ProgramFiles%\Autodesk\Revit\Macros\2022\Revit\AppHookup
  2. Launch Revit.
  3. Click Manage tabMacros panel Macro Manager.
  4. Click the Application tab.
  5. Select a module, and click Edit.
  6. The Revit macros IDE opens. Click Tools Project Upgrade.
  7. On the Project Upgrade tab, select the module.
  8. Specify a conversion language from the Convert selected projects to drop-down.
    • For C# macros, select C# 5.0
    • For VB.NET macros, select MSBuild 4.0
  9. Specify .NET Framework 4.5 Client Profile from the Change target framework drop-down.
  10. Click Convert.
  11. Repeat steps 5 through 11 for all application-level modules.
  12. When complete, click Close.
Note: In the event there are compatibility issues in the upgrade process, copies of the original project (for document-level macros) and application macros are placed in My Documents\Revit <release> and appended with ~R. These files may be hidden depending on your Windows Explorer folder settings.

The code in projects may need to be manually modified in order to successfully build and run the macros in Revit. Consult the SDK for the list of changes to the API in order to address any version compatibility issues.

Changes to the IDE

In Revit 2014, the Revit VSTA IDE was replaced with SharpDevelop. This will not change anything significant in the macro development workflow. The generated classes in the *.desinger.cs(vb) file are automatically updated. However, if you used the following classes in files other than the SDK samples, you need to manually update them as follows.

SharpDevelop classes (old) SharpDevelop classes (new)

Autodesk.Revit.UI.Macros.ApplicationEntryPoint

Autodesk.Revit.UI.Macros.ApplicationEntryPoint

Autodesk.Revit.UI.Macros.DocumentEntryPoint

Autodesk.Revit.UI.Macros.DocumentEntryPoint

Autodesk.Revit.UI.Macros.IEntryPoint

Autodesk.Revit.DB.Macros.IEntryPoint

Autodesk.Revit.UI.Macros.AddInIdAttribute

Autodesk.Revit.DB.Macros.AddInIdAttribute

Autodesk.Revit.UI.Macros.VendorIdAttribute

Autodesk.Revit.DB.Macros.VendorIdAttribute