Search for Getting Started Videos and Tutorials!

Getting started material and questions galore.

Please, newbies, search before asking, and work through the available material before trying to shoot yourself in your feet, knees, and elsewhere:

Marko's Plugin Development Playlist

Marko Koljancic, Digital Technology Manager at DiRoots, published a series of tutorial videos on Revit add-in development in Circle's Bim Blog and the YouTube channel Revit API - Plugin Development:

In this video series, we discuss how to develop your own C# .NET plugin for Autodesk Revit. Based on simple examples, I present essential concepts of programming additional functionality for Revit. On my LinkedIn profile, you can find articles for this series.

Thanks to Micah @kraftwerk_15 Gray for bringing it to my attention:

Oh, BTW, to all in this thread and in the future and @jeremytammik. Another good resource I've been tearing apart while looking at MVVM Navigation in the Revit context. Again, not mine. :) But also, there are videos on YouTube.

Here is Marko's description of his playlist:

Plugin Development Playlist – Overview

This is the full Revit API - Plugin Development Playlist on YouTube. It contains two projects. One essential for beginners and one more involved with WPF MVVM pattern and DockablePane control.

The first project targets beginner audience to Revit API. The idea is to create a super simple tool that can add text note elements containing wall layer information. I picked this because it I think it is a good project to showcase a common workflow for creating simple tools in Revit.

On top of the previous project I recorded the series for more medium to advanced users. The idea is to have a dockable pane type of add-in that is used to show family files from external directories and provide some commands through the right click context menu.

The idea behind this series is to start involving more community into using WPF, XAML and MVVM pattern of programming. I covered a lot of topics for styling, animations for hovering effects, animated transitions between pages in DockablePane, for example fading and sliding animation, things like that. I followed the MVVM pattern completely in this series (from my best understanding): data bindings, value conversions, ViewModel classes, etc.

The majority of the videos are covered with links in the description to written articles on my LinkedIn page. Some things are easier to write than record. Here is one example of such an article:

I didn’t record audio, but I heavily documented the code and cover them with the LinkedIn articles. The playlist is live and I plan to continue it.

I’m an architect and self-taught C# developer. I struggled in the beginning to figure out all these concepts on my own, still learning. This video series is my humble contribution to the wonderful Revit API community.

Ever so many thanks to Marko for all his hard work and kind sharing!

Plugin Development Playlist – Table of Contents

Short table of contents of the 18 videos in the Revit API - Plugin Development Playlist:

  1. Plugin Essentials – First steps, basic plugin setup (24:03)
  2. Plugin Essentials – Manage image resources and multiple project setup (39:08)
  3. Plugin Essentials – Tag Wall Layers Command and create Text Note Element (35:30)
  4. Plugin Essentials – Show Dialog Box and create SketchPlane (46:44)
  5. Plugin Essentials – Convert Imperial to Metric Units (26:21)
  6. Family Manager Plugin – Dockable Pane, Revit and WPF (35:57)
  7. Family Manager Plugin – WPF ViewModel, Buttons and Commands (22:59)
  8. Family Manager Plugin – Page Switcher Mechanism and Value Converters (19:22)
  9. Family Manager Plugin – Populate List of Family Items (43:18)
  10. Family Manager Plugin – Implement Page Transition Animation (20:11)
  11. Family Manager Plugin – Dark Theme and Styling (28:34)
  12. Family Manager – Custom Button Style (22:27)
  13. Family Manager – Item Type and Visual Indicator (20:14)
  14. Family Manager – Style Family Item in List View (19:19)
  15. Family Manager – Create and style right click context menu for items in list view (14:51)
  16. Family Manager – Preferences and Repository Locations (1:14:44)
  17. Family Manager – Repository Context Menu Functionality (33:31)
  18. Family Manager – Create Application Installer Executable File (11:48)

Getting Started with an API Script

Another beginners question came up in the Revit API discussion forum thread on my first basic script:

Question: I have a probably simple problem. I want to select many elements and add to the parameter "Comments" the value "Something". I don't know where the problem is ;/.

Answer: Welcome to the Revit API!

Looking at your code, I would suggest that you simplify it significantly.

Then the error will probably go away by itself.

The BIM element has one single comment field that you wish to set a value on, so there is no need to maintain a list of different parameters named "Comment" and loop through all of them with the call to Set.

Pick the one single parameter you need instead.

The best way to do so is to not use the "Comment" display name, but the built-in parameter enumeration value.

It may or may not be the BuiltInParameter ALL_MODEL_MARK.

To find out what it is, you should first of all install RevitLookup and explore the element that you wish to set the comment on to find the built-in parameter enumeration value corresponding to the parameter you wish to modify.

Let's say its value is B.

Then you can simply say:

  elemm.get_Parameter(B).Set("Something");

By the way, I would suggest that you make it simple for yourself: before doing anything else, work through the standard Revit API getting started material, the training videos, and the initial walkthroughs in the developer guide.

That will explain all the fundamentals and get you up and running smoothly with less hassle.

Once you have done that read about how to research to solve a Revit API programming task.

Good luck and have fun!

Getting Started with a Macro

Similar beginners questions cropped up on Revit macros as well, in two comments on the Five Secrets of Revit API Coding.

The answer is always the same:

I challenge you to come up with any beginners question that has not already been answered in depth, repeatedly and well!

OBJ Mesh Import with Materials

My friend Eric Boehlke is not a programmer and still created a Revit add-in selling in the AppStore, Mesh Import from OBJ files.

Here is a 3-minute demonstration of version 2.0 that makes Revit Materials available for the imported meshes:

2D Booleans in the Revit API

Finally, let's end this beginner's business with one final more interesting and geometrical question from the Revit API discussion forum thread on how to retrieve common geometry of all participants:

Question: I have faces intersecting. I want to retrieve the common geometry of all participants. How can I solve this?

Rectangle intersection

Answer: It sounds as if you are looking for a 2D Boolean intersection operation.

Revit does not provide this functionality.

However, you can easily make use of other .NET libraries implementing it and reference those in your Revit add-in.

I have repeatedly made use of the Clipper library for such purposes:

The last pointer highlights the most interesting and up-to-date sample using it so far, the ElementOutline add-in.

You should also check out the discussions in the topic group on 2D Booleans and Adjacent Areas.