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
- Plugin development playlist – overview
- Plugin development playlist – table of contents
- Getting started with an API script
- Getting started with a macro
- OBJ mesh import with materials
- 2D Booleans in the Revit API
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:
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!
Short table of contents of the 18 videos in the Revit API - Plugin Development Playlist:
- Plugin Essentials – First steps, basic plugin setup (24:03)
- Plugin Essentials – Manage image resources and multiple project setup (39:08)
- Plugin Essentials – Tag Wall Layers Command and create Text Note Element (35:30)
- Plugin Essentials – Show Dialog Box and create SketchPlane (46:44)
- Plugin Essentials – Convert Imperial to Metric Units (26:21)
- Family Manager Plugin – Dockable Pane, Revit and WPF (35:57)
- Family Manager Plugin – WPF ViewModel, Buttons and Commands (22:59)
- Family Manager Plugin – Page Switcher Mechanism and Value Converters (19:22)
- Family Manager Plugin – Populate List of Family Items (43:18)
- Family Manager Plugin – Implement Page Transition Animation (20:11)
- Family Manager Plugin – Dark Theme and Styling (28:34)
- Family Manager – Custom Button Style (22:27)
- Family Manager – Item Type and Visual Indicator (20:14)
- Family Manager – Style Family Item in List View (19:19)
- Family Manager – Create and style right click context menu for items in list view (14:51)
- Family Manager – Preferences and Repository Locations (1:14:44)
- Family Manager – Repository Context Menu Functionality (33:31)
- Family Manager – Create Application Installer Executable File (11:48)
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
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
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:
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!
Similar beginners questions cropped up on Revit macros as well, in two [comments](https://thebuildingcoder.typepad.com/blog/2018/09/five-secrets-of-revit-api-coding.html#comment-4790311788 ) on the Five Secrets of Revit API Coding.
The answer is always the same:
- Search for tutorials on the Internet. There are hundreds, at least.
- Search for YouTube video tutorials. Hundreds of those as well.
I challenge you to come up with any beginners question that has not already been answered in depth, repeatedly and well!
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:
Question: I have faces intersecting. I want to retrieve the common geometry of all participants. How can I solve this?
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:
- Room and Wall Adjacent Area
- Boolean Operations for 2D Polygons
- GetPolygon Extension Methods
- Boolean Operations for 2D Polygons
- Saving a Solid to a SAT File Implementation
- Creating Topography Contours and Building Masses
- More on Wall Opening Areas per Room
- Fire Rating Zone Intersection
- Automated PDF Report and 2D Sketch Booleans
- Extrusion Analyser and 2D Boolean Element Outline
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.