Skip to content

How To Use Add In Manager

Chuong Ho edited this page May 11, 2022 · 26 revisions

Welcome to the RevitAddInManager wiki!

Add an External Command

Add-In Manager can load an External Command to Revit by loading a .dll file that contains the External Command.

  • Click Add-Ins tab > External Tools > Add-In Manager.

  • In the main dialog, click Load assembly.

  • In the Open dialog box, select the .dll file you want to load and click Open.
  • The loaded .dll file with the External Command is listed on the Loaded Commands tab and selected by default. Click the .dll file, its path will be listed in the Notes field.

NOTE: An error message will be displayed in the Notes field when it fails to load the .dll file. Loading a .dll file will load any External Applications and External Commands it contains to Revit.

  • On the Loaded Commands tab, click the External Command.
  • The default command name is displayed in the Name field. You can edit it or enter a new name.
  • The default command description is displayed in the Description field. You can edit it or enter a new one.

Run an External Command

You can run an External Command through the main dialog after loading it.

  • On the Loaded Commands tab, select a loaded External Command you want to run.
  • Click "Run" button.

image

NOTE: If it fails to run the command, the error information will be listed in the Notes field.

  • You can also double click on a External Command node from the tree view to run the command.

Add an External Application

Add-In Manager for Autodesk Revit can add an External Application to Revit by loading a .dll file that contains the External Application.

  • Click Add-Ins tab > External Tools > Add-In Manager.
  • In the main dialog, click Load.

image

  • In the Open dialog box, select the .dll file you want to load and click Open.

image

  • The loaded .dll file with the External Application is displayed on the Loaded Applications tab and selected by default. Click the .dll file, its path will be displayed in the Notes field.

NOTE: An error message will be displayed in the Notes field when it fails to load the .dll file. Loading a .dll file will load any External Applications and External Commands it contains to Revit.

After Revit is restarted, the loaded External Application will run at the startup and close of Revit.

Remove an External Command or Application

If an External Command or Application is no longer needed, you can remove it through Add-In Manager. You can remove only one External Application or Command each time. The corresponding .dll file is not deleted from the disk.

  • Click Add-Ins tab > External Tools > Add-In Manager.
  • In the main dialog, on the Loaded Commands or Loaded Applications tab, click the .dll file that contains the External Command or Application you want to remove.
  • Click Remove. The item you selected is removed from the list.

image

Note : You can remove event class command and use F5 from keyboard or can remove all by click to parrent of all class command.

Save External Command or Application to manifest file

Revit supports the new .addin manifest registration mechanism. It's inconvenient to write a manifest file manually. With Add-In manager, you can do it easily

  • Click Add-Ins tab > External Tools > Add-In Manager.
  • In the main dialog, on the Loaded Commands or Loaded Applications tab, all the commands/applications are checked by default.
  • Uncheck any command/application that you don't want to save. (Optional)
  • Click Save.
  • The path of the saved .addin manifest file is shown in the "Note" text box Note: If you still plan to modify and debug the addin, don't use this feature. Let the addin be managed by Add-In Manager until you finish the development and won't modify/debug the code any more. Reason: Every time Revit launches, it will read those Manifest files and load the addin DLLs into its AppDomain when execution. After that, the addin DLL is locked by the Revit process and you can't edit & compile the code as long as the Revit process exists

Advanced

Use Add-In Manager with hotkeysUse Add-In Manager with hotkeys

Revit allows setting hotkeys to external tools. While Add-In Manager is also an external tool, user can set hotkeys to it to accelerate the operations.

  • Click Application Menu->Options.
  • In the "User Interface" tab, click "Customize" button for "Keyboard shortcuts".
  • In the "Keyboard Shortcuts" dialog, select "Add-Ins Tab" from the "Filter" drop-down list.
  • Set hotkeys to External Tools: Add-In Manager(Manual Mode), say, "AA".
  • Set hotkeys to External Tools: Add-In Manager(Manual Mode, Faceless), say, "SS".
  • Close this dialog. Press "A" twice, the Add-In Manager dialog shows up!

Faceless mode of Add-In Manager

Add-In Manager shows up to user with a dialog box, user must specify a command from the list for execution each time. When user is developing and debugging an single add-in for many times, he/she still has to specify the command before executing it, it's totally meaningless and unnecessary. With Add-In Manager Faceless mode, you can get rid of all the mouse operations and call the command quite easily!

How to Debug addin with Faceless Add-In Manager? (Before go to next section, make sure you set hotkeys to Add-In Manager. In the following steps, I assume setting hotkey "AA" to Add-In Manager UI-mode and "SS" to Faceless-mode)

  • Write code and compile it;
  • Launch Revit;
  • Press key "A" twice (it's the hotkeys you set for Add-In Manager, you can set as you like) to Launch Add-In Manager UI-mode (with UI dialog showing up)
  • Pick a command and run it;
  • Find some bugs, return to code, edit and compile the code;
  • Press key "S" twice to run the command just executed. You needn't wait for UI dialog and specify the command by mouse operations. Note: The faceless Add-In Manager runs the MRU(most recently used) command. If user launches Revit, then run Add-In Manager faceless directly, Add-In Manager will turn to the UI mode automatically since there's no MRU command.

Develop & Debug addins with Add-In Manager

Here is a comparison of developing addin with/without Add-In Manager. The operations which requires much time are marked as red

Launcher

without Add-In Manager with Add-In Manager
Write code Write code
Compile Compile
Launch Revit Launch Revit
Click "Add-ins" ->"External tools" ->launch your add-in 1. Launch Add-In Manager with simple keystrokes defined for Add-In Manager(UI mode);
2. Load the addin dll into AIM;
3. Double-click the command item to run it

Find the add-in has some bugs, you will:

without Add-In Manager with Add-In Manager
Close Revit
Modify your code and compile Modify your code and compile
Open Revit
Click "Add-ins" ->"External tools" ->launch your add-in Launch your add-in with simple keystrokes defined for AIM(faceless mode)

Add/rename/remove some EC/EA classes, you will:

without Add-In Manager with Add-In Manager
Close Revit
Modify your code to add/rename/remove EC/EA classes and compile Modify your code to add/rename/remove EC/EA classes and compile
Modify your revit.ini or .addin file
Open Revit
Click "Add-ins" ->"External tools" ->launch your add-in 1. Launch AIM with simple keystrokes(UI mode)
2. Remove the add-in dll and re-load it to update the EC/EA class list
3. double click the EC command item to execute

Glossary Terms

ExternalCommand

Autodesk Revit API enables you to add new commands to Autodesk Revit. These commands will be added to the External Tools in the Add-Ins tab. Through the API, External Commands have access to the Revit database, as well as the currently selected elements.

ExternalApplication

Autodesk Revit API enables you to add External Applications which provide the same access as the ExternalCommand and also provide the ability to create new ribbon panels, pushdown buttons, pulldown buttons and react to application events.

RevitAPI

For more information about RevitAPI and Add-Ins, please reference to RevitAPI forum