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.
- Visual Studio Revit add-in wizards on GitHub.
- Updated VendorId tag value.
- Wizard installer batch file.
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:
- My Text Based Calendar
- The pcal PostScript calendar program
- The Google Calendar API
- Adding an event to the Google calendar
- Google OAuth credential handling
- Date and time parsing and formatting
- Adding a calendar event
- Mainline
- GitHub pages
- GitHub repository
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:
- Clone the GitHub repository:
C:> git clone https://github.com/jeremytammik/VisualStudioRevitAddinWizard
install.bat
:C:> install.bat Z:\a\doc\revit\tbc\src\VisualStudioRevitAddinWizard>install.bat Creating C# wizard archive C:\Users\tammikj\AppData\Local\Temp\Revit2016AddinWizardCs2.zip... adding: App.cs (deflated 54%) adding: Command.cs (deflated 59%) adding: Properties/ (stored 0%) adding: Properties/AssemblyInfo.cs (deflated 56%) adding: RegisterAddin.addin (deflated 66%) adding: TemplateIcon.ico (deflated 76%) adding: TemplateRevitCs.csproj (deflated 70%) adding: TemplateRevitCs.vstemplate (deflated 62%) Copying C# wizard archive to C:\Users\tammikj\Documents\Visual Studio 2012\Templates\ProjectTemplates\Visual C#... 1 file(s) copied. Creating VB wizard archive C:\Users\tammikj\AppData\Local\Temp\Revit2016AddinWizardVb2.zip... adding: AdskApplication.vb (deflated 68%) adding: AdskCommand.vb (deflated 58%) adding: My Project/ (stored 0%) adding: My Project/AssemblyInfo.vb (deflated 54%) adding: RegisterAddin.addin (deflated 67%) adding: TemplateIcon.ico (deflated 76%) adding: TemplateRevitVb.vbproj (deflated 72%) adding: TemplateRevitVb.vstemplate (deflated 62%) Copying VB wizard archive to C:\Users\tammikj\Documents\Visual Studio 2012\Templates\ProjectTemplates\Visual Basic... 1 file(s) copied.
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!