When the window pops up we need to navigate to our CurveTotalLength project location and look for CurveTotalLength.cs file. Next, let’s add our existing CurveTotalLength project to this solution (SHIFT + ALT + A). Now, let’s just quickly rename the default Class1.cs to App.cs like so(see image above): Next, just like we discussed before we need to reference in Revit API and Revit APIUI libraries. We will call it GrimshawRibbon, but you can call it whatever you want – just remember that it’s not easy to rename the project folder structure after it was created. So let’s create a new project in Visual Studio. The easiest way is to actually just create a new project and add an existing one to it if needed. Unfortunately there isn’t an easy way to just take an existing project in Visual Studio and rename it. This was just a quick maintenance procedure to make sure that our file is named properly because next what we will do is import that file into a new Project in Visual Studio. Now, let’s just “Build it” and we can close that file.
For the sake of keeping this tutorial simple and easy to follow, I will only show you how to convert our all-ready CurveTotalLength tool to a button. Luckily for us Revit API offers a way to create our own tab in Revit and an array of different ways to add buttons to it. Doing that is a great and really fast way of adding new tools to Revit, but after a while we will realize that we just need a little more organization. In the last few posts I have outlined in great detail how to make a simple Revit Add-in using the IExternalCommand implementation.