Search code examples
autodesk-forgeautodesk-designautomation

Forge DA for Revit Multiple Versions


Ok I think we have a DA for Revit app running in Forge, but the next question is how to support multiple Revit version and I can't find a ton of documentation on it. Here is what I understand (or think I do anyway) and the questions I have:

Each app bundle and activity can only define one engine so it seems like you would need to create a bundle for each supported Revit version as well as a related activity for each Revit version. Questions on this:

  • 1: The package bundling system allows for multiple Revit versions to be supported. Does DA require that each bundle support only one Revit version or is there a way to support multiple versions that I'm missing?
  • 2: What happens if the engine for the activity is different from the bundle? Is that just unsupported and if so why is there an engine argument in both?

App bundles are referenced by their ID. Most of the examples show the ID as something like 'DeleteWallsApp' or whatever. However, if you truly need multiple app bundles for multiple Revit versions then would you actually want to use ID's like 'DeleteWallsApp2018' and 'DeleteWallsApp2020', etc.? You couldn't have multiple ID's that are the same so that seems the most pertinent way to do it. Is this correct?

Bundles and activities are also referenced by their alias. If I understand they are meant for dev/staging/production aliases for testing vs. production code, etc. If so, is it recommended then to have those aliases for each bundle?

This seems like a lot of stuff to upload to a lot of different places but I guess it's not too bad if you automate the system. I just want to make sure I'm not missing some part of the structure.


Solution

  • The activity can override the engine version specified by the appbundle. Like your desktop addins, an appbundle built on Revit 2018 will work on Revit 2019 and higher, as long as all APIs referenced are compatible (we rarely obsolete some). So, you could have one appbundle built on Revit 2018, and have multiple activities referencing the same appbundle and higher engine version than the appbundle references.

    You also have the flexibility of using one single activity unqualified id that serves multiple engines through aliases. For example below shows how you may do so with DeleteWallsActivity.

    YourNickname.DeleteWallsActivity+dev_2018
    YourNickname.DeleteWallsActivity+stg_2018
    YourNickname.DeleteWallsActivity+prod_2018
    YourNickname.DeleteWallsActivity+dev_2019
    YourNickname.DeleteWallsActivity+stg_2019
    YourNickname.DeleteWallsActivity+prod_2019
    

    Or create an unqualified id for each engine. For example the below shows DeleteWallsActivity2018 and DeleteWallsActivity2019.

    YourNickname.DeleteWallsActivity2018+dev
    YourNickname.DeleteWallsActivity2018+stg
    YourNickname.DeleteWallsActivity2018+prod
    YourNickname.DeleteWallsActivity2019+dev
    YourNickname.DeleteWallsActivity2019+stg
    YourNickname.DeleteWallsActivity2019+prod
    

    Since each fully qualified id YourNickname.YourActivity+alias has an activity version associated with it and each of those in turn references their respective appbundles with their fully qualified id, you can have any one of the schemes above irrespective of whether you created single or multiple appbundles per engine.

    Also read more about aliases and ids here: https://forge.autodesk.com/en/docs/design-automation/v3/developers_guide/aliases-and-ids/