#Revit icon code#
*You will notice that we also defined using System.Reflection in code below. First let’s create a “road map” using pseudo code before we start filling in the blanks: Now, that we have all of the assemblies needed*, we can get to implementing IExternalApplication. In search field type in “Presentation”.Click on “Assemblies” on the left side.Right click on References in Solution Explorer, then click on Add Reference….Next let’s quickly add a new folder to our project and then move(drag and drop) the CurveTotalLength to that folder to keep our application nicely organized:īefore we start implementing the IExternalApplication, we need to make sure that we have all of the “using” statements as well as one more assembly loaded (PresentationCore), that we will need to define an icon/image for our button. You should see a new file appear in your Solution Explorer like so: 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.
![revit icon revit icon](https://icon-library.com/images/revit-icon/revit-icon-14.jpg)
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. Click on Rename and type in “CurveTotalLength.cs”.On the right hand side, in our Solution Explorer I will first change the name of the CurveTotalLength cs file from Class1.cs to CurveTotalLength.cs. In this post we will cover a few things like:įirst let’s open our Visual Studio session that we worked on last week.
![revit icon revit icon](https://nsdrafter.com/my_content/uploads/2018/10/Blog-picture-hidro-revit2.png)
#Revit icon how to#
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.