Revit Add-In Wizard GitHub Installer

I recently mentioned the unrestricted VendorId in Revit 2016, and pointed out that I would like to update the Visual Studio Revit add-in wizards accordingly.

I now went ahead and did so, adding a couple of other enhancements as well along the way – oh, and I did some work on putting my personal calendar online, as well:

Sharing a Calendar via GCal, Google API, and GitHub Pages

I fiddled around a bit in the past two days to share my calendar online via the cloud, for personal convenience and to provide access to friends and colleagues.

Here is an overview of the steps I took:

Back to the Revit API...

Visual Studio Revit Add-in Wizards on GitHub

I created a new VisualStudioRevitAddinWizard GitHub repository to host the wizards and simplify the tracking of changes I make along the way.

It includes releases supporting all versions of Revit from Revit 2012 onwards.

Updated VendorId Tag Value

I updated the default VendorId tag from TBC_, The Building Coder Autodesk registered developer symbol or RDS, to com.typepad.thebuildingcoder, the reversed version of its domain name, as recommended by the Revit developer guide, in the Revit 2016 online help > Developers > Revit API Developers Guide > Introduction > Add-In Integration > Add-in Registration.

The wizard now generates an add-in manifest file looking like this:

<?xml version="1.0" encoding="utf-8"?>
<RevitAddIns>
  <AddIn Type="Command">
    <Text>Command RevitAddin1</Text>
    <Description>Some description for RevitAddin1</Description>
    <Assembly>RevitAddin1.dll</Assembly>
    <FullClassName>RevitAddin1.Command</FullClassName>
    <ClientId>9d12d875-a6f8-44dc-b346-ec29e4153527</ClientId>
    <VendorId>com.typepad.thebuildingcoder</VendorId>
    <VendorDescription>The Building Coder, http://thebuildingcoder.typepad.com</VendorDescription>
  </AddIn>
  <AddIn Type="Application">
    <Name>Application RevitAddin1</Name>
    <Assembly>RevitAddin1.dll</Assembly>
    <FullClassName>RevitAddin1.App</FullClassName>
    <ClientId>c38b3dfc-2b1c-463f-a871-0943bb947f08</ClientId>
    <VendorId>com.typepad.thebuildingcoder</VendorId>
    <VendorDescription>The Building Coder, http://thebuildingcoder.typepad.com</VendorDescription>
  </AddIn>
</RevitAddIns>

Wizard Installer Batch File

Once I was at it anyway, I thought about how to further simplify installation of the wizard.

The wizard template files need to be zipped up into an archive file which is then placed in the corresponding Visual Studio project template file subdirectory, as described repeatedly, e.g. for the last update of the Visual Studio add-in wizards.

That can be simplified and automated by setting up a suitable batch file, so I did.

Here is the first version of install.bat, also included in the GitHub repo:

@echo off
set "D=C:\Users\%USERNAME%\Documents\Visual Studio 2012\Templates\ProjectTemplates"
set "F=%TEMP%\Revit2016AddinWizardCs2.zip"
echo Creating C# wizard archive %F%...
cd cs
zip -r "%F%" *
cd ..
echo Copying C# wizard archive to %D%\Visual C#...
copy "%F%" "%D%\Visual C#"
set "F=%TEMP%\Revit2016AddinWizardVb2.zip"
echo Creating VB wizard archive %F%...
cd vb
zip -r "%F%" *
cd ..
echo Copying VB wizard archive to %D%\Visual Basic...
copy "%F%" "%D%\Visual Basic"

With that in place, and the command line zip utility for Windows installed, download and installation consists of the following simple two-step process:

I hope this works out for you as well.

Please let me know if you hit any snags.

Better still, fork the GitHub repo, fix them, and request a pull. Thank you!

Happy weekend!