Dear Dynamo aficionados
I recently hosted a lab at the BILT EUR 2018 conference in Ljubljana, Slovenia teaching the basics of Dynamo Zero Touch node development using C# in Visual Studio…in 75 minutes.
For those who did not attend the BILT conference this year but are interested in C# node development, I’ve attached the full dataset from lab, including the 60-page handout, for your delectation.
The exercises are ideal for those looking to acquire coding skills but do not know where to start, or for experienced Dynamo users reaching the limits of visual programming. If you’re an IronPython developer, but wary of strong-typed languages such as C#, this is a great opportunity to overcome any barriers and develop skills using an elegant language with a powerful IDE.
Why Develop Nodes in C#?
There are numerous reasons to create Zero Touch nodes using C#, including:
- Fully integrated in an IDE (Visual Studio), providing IntelliSense and debugging which make coding easier than any other option (and yes, that includes IronPython)
- Speed – Zero Touch nodes execute rapidly making them ideal for complex problems on large projects
- Full access to the Revit API, Dynamo API and ability to communicate with external applications
- Code is more secure and easier to protect if IP is a concern
Lab Contents
The lab – or rather, the handout and exercises – are delivered through practical exercises covering:
- Visual Studio and Zero Touch environment configuration
- Key C# and Zero Touch Concepts
- Creating namespaces, classes, methods and properties
- Creating compiled assemblies and Zero Touch import
- Navigating the Revit API and making API calls in your nodes
Before starting, ensure the following software is installed:
- Revit 2018.3
- Dynamo 2.0
- Visual Studio Community 2017 – Use the Visual Studio Installer and select/install the .NET Desktop Development Workload
- Revit Lookup
Handout
The handout is available for download on the link below. The handout covers the exercises from the lab, with tips and useful links throughout the document. I recommend undertaking the handout exercises while referencing the presentation slides as this will aid your understanding of the concepts.
Download the handout
Presentation and Tips + Tricks
I’ve published the presentation and Tips + Tricks slides on my website news articles. If you want to view and download them, click the link below:
See the Presentation and Tips + Tricks slides
GitHub Repo - Get the Source Code
You can compile the lab project exercises from source by downloading it from the Bimorph GitHub repository to your local machine on the link below. If you get stuck, or find things just aren’t working as you undertake the exercises, then you may find it useful to compare your progress against this repo and ‘reverse-engineer’ it to improve your understanding.
The GitHub repo is located here: BILT EUR 2018 Dynamo ZeroTouch Source Code
To download the repo, we recommend using the GitHub desktop app. Download it from github.com. Once installed, launch the app and click on File > Clone Repository. In the dialog box that opens, click on the URL tab and copy/paste the repo URL into the Repository input box and select a location on your local machine to save the files. Click the Clone button to complete this step:
To open the project, simply browse to the location where you saved the project and open the ZeroTouchNodes.sln file and Visual Studio will launch (make sure it is already installed!). To build the solution, click Project > Build and if it is successful, you will see the ZeroTouchNodes library appear in Dynamo.