REX Add-In Development and Migration

It's been a while since I talked about REX.

Some old dedicated posts include:

More recent mentions occur in my discussion of a framing cross section analyser with and without REX and its migration to Revit 2015.

Now the time has come for another look, prompted by the following developer query:

Question: I am currently working on an API to generate plan views with loads. The API works fine on my machine, it's not super-efficient probably; as I am not an expert about programming (limitations of structural engineers – sorry), but it does the job.

The project has been built based on the REX 2014 SDK.

When I started the project, I used my personal account, without any subscription, thus I was not entitled to use the advanced settings. This is because I didn't intend to deploy it to the entire company – however, we are now thinking of doing so.

I had a look at the REX SDK manual and it says that I need the subscription to use the advanced settings.

In general, I am not entirely sure about how to finalise the job so I would be very grateful if someone could give me advice on the following:

  1. Upgrade the API to newer versions;
  2. Create a custom ribbon palette that is automatically installed when Revit is installed on someone else's machine;
  3. Make sure the add-in goes under that ribbon palette;
  4. Generate an installer EXE file to distribute to the company.

Thank you very much in advance.

Answer: Congratulations on implementing an add-in that does the job.

I am not familiar with the advanced settings that you mention.

As far as I know, all different possible flavours of the Revit and REX APIs are identical, and there is no differentiation whatsoever between different levels of entitlement or access.

I do not have anything much to suggest regarding your questions on creating an installer, either.

That is obviously not really related to the Revit or REX APIs.

I have seen various cool examples of installers in several publicly available sample applications, and mentioned some of them now and then on The Building Coder, e.g., for the RevitRubyShell.

One way to get official help from Autodesk with you installer is to package your add-in for the AppStore.

If you are happy to make it available in public, that would probably be the easiest way to go, and offer lots of possible additional benefits as well.

Answer II: This was followed up by a more in-depth answer from the development team:

I assume that user project was built in Visual Studio 2010 for Revit 2014 and now it's planned to have it working in Revit 2016.

It's possible to update your project to new version by following steps:

  1. Install Autodesk Revit 2016.
  2. Install Microsoft Visual Studio 2012 (or later).
  3. Open source project, update all references to 2016 version, e.g., RevitAPI.dll, RevitAPIUI.dll, Autodesk.REX.Framework, etc.
  4. Change target .NET platform version from 4.0 to 4.5.
  5. Update version in settings.xml file
  6. Update version in DirectRevitAccess.cs in the method currentDomain_AssemblyResolve replacing "2014" by Autodesk.REX.Framework.REXConfiguration.Control.VersionName.
  7. Update version in Program.cs in similar way as point 6
  8. Update source code with latest Revit API changes – the documentation file "Revit Platform API Changes and Additions.docx" might be helpful.
  9. Addin manifest file should be placed now in Revit 2016 addins directory.

There is information about advanced settings in SDK but it means that the end user needs to have the Revit Extensions (subscription only) installed.

If you would like to have your module working for users without Revit Extensions installed, you need to handle this yourself, for example by creating your own external application.

In this case you can do everything supported by the Revit API with the ribbon, e.g., create your own ribbon tab, add panels and buttons to it, etc.

The 'advanced settings' give the ability to integrate the module into the Revit Extension ribbon and create an installation project (Visual Studio 2010 only):

REX app

It appears that you would like to create your own ribbon.

Another option is create a new module with 'Support for Exchange' enabled and move all code to that:

REX app

This will give the possibility to launch the Extension ribbon on computers with or without Revit Extensions with following results:

REX app

The REX SDK documentation includes a description about how this can be achieved. The new module is also an external application ready to be installed in the ApplicationPlugins directory.

Unfortunately, you have to manage your own deployment and installation using the current Visual Studio deployment projects or some other installation system like NSIS.

I hope this helps.

Good luck and have fun making use of the REX SDK!