Revit Add in’s with C# & Visual Studio Part 1

I haven’t played much with C# and revit add-ins for a while and I thought it would be good to re-explore the process. The last time I was trying to do so was about 3 years ago so I thought I’d look on Mr YouTube to see what has appeared since my last effort. It seems there are a few more video’s up to help you start.

When I was last doing it I worked through the Microsoft visual Studio c# beginners course to get the feel of the programme and also for some OOP (Object Oriented Programming) concepts and uses. The course was good but not in my area of interest, but it gave me the basics. As time has passed I’m feeling a little more confident with programming, so feel its worth trying to do some more Revit Plug-ins. In my earlier attepts I only got one programme/function actually working, so not very successful.

I’m currently doing a couple of projects with Revit and want to Automate a few things to speed up the proces, so I thought I’d dive back into Visual Studio, C# and Revit API’s.

Articles that re-awakened my interest on the subject

I get the weekly BimSider Roundup on Revit and this week he highlighted a couple of articles on Revit programming.

The first I thought was a very good basic intro from BIM Squared. Customize Revit with C# [The Basics] by James Simpson .

The 2nd was steps to learn to code [for architects & designers] part 1 by lisa-marie mueller. I went back to her first article and need to read the later ones.

So I decided,. as I have a new computer that I’d load up Visdual Studio.

Video’s on C# and Visual Studio.

I thought this setup (vid 2 in series) was useful. He covers concepts but does not run the programmes which I thought was a bit irritating, but overall a good overview for C# & Visual Studio IDE.

Some references to fast keys are here.

Videos on Revit API C# Beginners Guide to Getting Started with

This looks good, I only watched the first one and the size of font on screen was quite small, so a bit of a pain, and he went a bit fast too. I may have to revisit and watch the later ones.

Bim Girl’s setup

This lady has such a bubbly personality and is a pleasure to watch. She also starts off simple and I’ll be following her Revit API setup from the video below, then adding later bits (building the plugins directly to Revit add-in directory) from the video series above.

In the video she referes to AutoDesk Lesson 1: The Basic Plug-in.

She also starts a C# ClassLibrary (.NET Framework) project, not a ClassLibrary (.NET Standard) which I did the first time.

In her video rather than copying the .dll and .addin files to the C:\ProgramData\Autodesk\Revit\Addins\201? folder she leaves the path to the .dll where it is generated and only moves the .addin file to the abovce path. I suppose it works either way. I think the chap above does it better by generating the .dll file into the C:\ProgramData\Autodesk\Revit\Addins\201? folder so its ready to go, also he triggers the debug to start revit straight away to test to see if it works. A better workflow. But I appreciate that Bim Girl is at the simple end of the process.

Alos , after following her video I got the copy Group addin working pretty quickly. Well done that girl.

Joshua- pretty good dude

I watched his first video in End comment and added setup versionm here.

End comment

This is just documenting my process. So its really just the setup of the process for future reference.

I did have a few add-ins I wanted to explore for Revit, one of them had to do with selection and colour but I cannot recall it at this point.

Another was switching Room infill & reference lines on/off which I seem to do a lot. I would like something like AutoCad layer control with fast keys and need to experiment to see how I can do that.

Now that I have the very basics up and running I can begin to explore the Revit API and look to make some simple productivity apps.

The video below looks veery good, secret number 2 is invoke that allows you to do multiple builds but not restart revit to test. Brilliant. I remember the frustration of shutdown/restart that took ages for testing.