Have a question?
Message sent Close
4.2 out of 5
4.2
191 reviews on Udemy

Learn to program the Revit API by Boost Your BIM

Learn how to customize, automate, and improve Autodesk Revit software.
Instructor:
Harry Mattison
730 students enrolled
English [Auto] More
In this course, you will learn how to write Revit API code in the C# language to perform a wide variety of tasks.

This course is for people who want to do more with the Autodesk Revit building information modeling software.

You can do a lot of great things with Revit as it ships "out of the box" from Autodesk, but there are still many tasks that are repetitive, boring, and error-prone. There are also many situations where you can be more effective and productive if you can add additional functionality to Revit.

This course will cover a wide range of topics in the Revit API. Each topic will be taught by walking through a set of C# code samples that progress from the basics to more advanced concepts.

More content will be added to this new course in the upcoming weeks. If you see a topic that you like added, just let me know and I will try to make that addition.

Revit API Basics

1
Introduction: A Simple Macro
2
Prompt user to select an element & get element info

Prompt the user to select an element and retrieve data from that element.

The "Exception Handling" lecture is recommended to learn how to handle the user pushing the ESC key during a selection prompt.

3
Prompt user to select edge or face & get edge/face info
4
Selection - getting and setting selected elements

Get the elements selected in the Revit UI and use the API to set which elements are selected.

5
Find Elements - FilteredElementCollector #1

Find elements in a Revit model using filters by Class (such as Wall or FamilyInstance) and Category (such as Door and Window)

6
Find Elements - FilteredElementCollector #2

Find elements that are visible in a specific view.

Find elements whose bounding box is inside a 3D space defined by two mouse-clicks

7
Find Elements - LINQ queries

Use LINQ (Language-Integrated Query) syntax to develop more sophisticated queries of elements in the Revit model

8
Find Drafting Views that contain a CAD Link
9
Create an External Command

Create an external command using Visual Studio Express

10
Family Types and Parameters

Create family types, family parameters, and set parameter values

11
Get Line Length and Convert Units

Get the length of multiple selected lines and convert their total length from feet (Revit's internal units for length) to the project's units

.NET, C# and general programming basics

1
Read and Write Text Files

Revit macros to read and write text files

2
Directory and Path operations

Find the TEMP folder and the My Documents folder, combine folder and file names, and find all files in a folder.

3
Read from Excel into a Revit API external command

Read data from Excel into a Revit API external command

4
Write Revit data to Excel

How to write Revit data to an Excel file in a Revit API external command.

Includes using the Process.Start command to open a file in its default application.

You can get the EPPlus component for Excel read/write with NuGet (https://www.nuget.org/)

"An essential tool for any modern development platform is a mechanism through which developers can create, share, and consume useful code. Often such code is bundled into "packages" that contain compiled code (as DLLs) along with other content needed in the projects that consume these packages.

For .NET (including .NET Core), the Microsoft-supported mechanism for sharing code is NuGet, which defines how packages for .NET are created, hosted, and consumed, and provides the tools for each of those roles."

In Visual Studio go to Tools - NuGet Package Manager - Manage NuGet Packages for Solution - then browse for EPPlus. Select EPPlus by Jan Kallman

Or you can download the DLL from https://drive.google.com/file/d/1q1ZnRpK4XLdstVzbK3oUc0Qf61-3kLIA/view?usp=sharing or attached to this lecture. If you do that, be sure to unblock the DLL (right click on it in Windows Explorer, select Properties, Unblock) after downloading it.


5
Exception Handling

How to handle exceptions (errors) that occur while running your Revit API code.

6
Code Reuse and Helper Functions

How to write and reuse functions that make your code easier to update and maintain with fewer bugs.

7
Obsolete Members

What it means when a member of the Revit API is marked "obsolete"

8
Creating Windows Forms for User Input

Create a Windows Form dialog to allow the user to enter information that will be used by an API command

Element Operations

1
Delete an element - Intro to modifying the document

How to modify the Revit Document and delete an element

2
Create text note and get and set parameter values

Create a text note

3
Set parameter value & Check parameter storage type

How to check the type of a parameter (string, integer, double, element id) and set its value

4
Built in parameters

Get data from a Revit element using Built In Parameters

5
Collecting element area and keynote properties
6
Create wall
7
Create Family Instance (Furniture)

How to create a Furniture family instance

8
Create Family Instance (Door)
9
Element Rotation
10
Get Workset of an element

Element Geometry

1
Element Location - LocationCurve & LocationPoint

Find the point or curve that defines the location of an element

2
Get geometry of host faces

Find area of faces of walls, floors, roofs, and other host objects.

Watch "Code Reuse" lecture to learn how to improve the code shown here.

3
Get Curves and Solids of an element

Debugging Revit API Code

1
Step Into a Macro

Step Into a Macro to debug your macro code. Set breakpoints and create watches in SharpDevelop to see what is happening as your code executes.

2
Debugging external commands in Visual Studio

Intermediate / Advanced topics

1
Set Project Units
2
Selection Filters

How to prompt the user for a selection and only allow selection of specific categories

3
Events

How to register an event to automatically run Revit API code when specific actions occur in the Revit session.

The DocumentSaving event is demonstrated in this lecture to show how to create and update a log file with the time of save and the user's name.

4
Ribbon UI - tab, panels, buttons

Create a ribbon tab, panels, and buttons with an external application

5
Write comments to the journal file
6
Extensible Storage

Store data in Revit elements that is accessible only via the Revit API

7
Reference Intersector

How to "see" in the Revit model by shooting imaginary arrows and finding out what they hit

8
Dynamic Model Update

How your API code can automatically react to user changes in the Revit model

Source Code from BoostYourBIM blog posts

1
Get Categories & Materials from multiple Revit families

See this in action at http://youtu.be/dY9g4MATRG0

2
Record view creation date in a shared parameter

See this in action at http://youtu.be/VKT0_wBAdiY

Responses to Questions

1
Code Samples

This "lecture" will contain code samples to answer questions. This is being done because code formatting does not display properly in the Udemy Q&A interface.

2
File Version Check
3
Topo From Lines
You can view and review the lecture materials indefinitely, like an on-demand channel.
Definitely! If you have an internet connection, courses on Udemy are available on any device at any time. If you don't have an internet connection, some instructors also let their students download course lectures. That's up to the instructor though, so make sure you get on their good side!
4.2
4.2 out of 5
191 Ratings

Detailed Rating

Stars 5
101
Stars 4
58
Stars 3
24
Stars 2
5
Stars 1
3
5f2c1c278e624011aeeaac00b4137703

Includes

6 hours on-demand video
3 articles
Certificate of Completion

About

AulaGEO is a Ge-engineering specialized academy.

Social Network

Udemy Black Friday Sale! Top Courses From $9.99