14 - 16 November, 2022, València, Spain
BILT Europe 2022, Valencia

Session 2.5

Tuesday, 15 November, 2022 | 03:15 PM

c# w/o cs for Revit: Fast-track introduction c# and object-oriented programming for Revit plugins (continued)

BILT
Architecture, Coding and Customisation
Non Vendor Specific
Lab
All Levels

Synopsis:

This lab introduces basic programming concepts required to develop Revit plugins using c#. It consists of two parts: first, we code a simple Revit-analogous document as a simple means to explore object-oriented programming and then, in the second part, create a Revit plugin. 

(All LAB attendees must bring their own devices)

Learning Objectives:

1. Become familiar with c# using Visual Studio (free Community edition) 
2. Develop clearer understanding of Revit API and object model 
3. Learn how to set up a new plugin for Revit using c# 

Body:

Autodesk provides an API (Application Programming Interface) to create Revit plugins in .NET compliant languages such as vb.net and c#. Documentation and online examples generally use one of these two languages. Though it usually takes considerable investment in time and effort, the payoff for learning how use these languages to enhance Revit is immense. Not only do custom functions greatly improve accuracy and efficiency when working with the program, familiarity with the API also provides deeper insight into how Revit works ‘under the hood.’

Dynamo and RevitPythonShell gurus may also profit from an introduction to c# in order to gain a better understanding of the Revit .NET API.
This lab introduces basic concepts of object-oriented programming by creating a Revit-analogous document with familiar objects such as walls and columns. We will use Visual Studio Community IDE – a free, powerful coding software, to create this document. This will provide a simple means demonstrate basic principles such as object properties and methods and to investigate more abstract topics such as events, polymorphism/casting, enumerations and iteration. Familiarity with these concepts helps to understand the Revit API. After this quick and hopefully painless primer on object-oriented programming, we will create a Revit plugin, armed with the knowledge gained in the pseudo-Revit exercise. For this part of the lab, Visual Studio will not only assist in coding and debugging but will allow us to explore the Revit API model directly.
Of course, knowledge of c# can be useful beyond Revit plugin development, from creating stand-alone applications to designing custom functionality for Rhino/Grasshopper, AutoCAD and MS Office programs. The .NET framework also offers a rich palette of GUI (graphical user interface) controls. This brief, simple introduction to programming may inspire you to delve deeper into the world of coding and the Revit API.

(All installation instructions will be provided by the speaker)

Supported By