Donate Now Goal amount for this year: 2500 USD, Received: 1627 USD (65%)

Results 1 to 6 of 6
Like Tree16Likes
  • 11 Post By Thomas__Mahon
  • 1 Post By elton williams
  • 1 Post By Jozi
  • 3 Post By Thomas__Mahon

Thread: Become a Dynamo Zero Touch C# node Developer in 75 Minutes

  1. #1
    Junior Member
    Join Date
    October 14, 2017
    Location
    London
    Posts
    7
    Current Local Time
    12:40 PM

    Become a Dynamo Zero Touch C# node Developer in 75 Minutes

    Dear Revit Forum 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:

    1. Revit 2018.3
    2. Dynamo 2.0
    3. Visual Studio Community 2017
      – Use the Visual Studio Installer and select/install the .NET Desktop Development Workload
    4. 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

    The presentation and Tips + Tricks slides are available to view and download on the link below:
    See the Presentation and Tips + Tricks slides







    If you have any questions, feel free to post them to the thread.
    Attached Thumbnails Attached Thumbnails Become a Dynamo Zero Touch C# node Developer in 75 Minutes-bimorph-dynamo-zero-touch-node-developer-handout-image.png   Become a Dynamo Zero Touch C# node Developer in 75 Minutes-bimorph-become-zero-touch-c-node-developer-75-minutes.jpeg  
    Last edited by Thomas__Mahon; November 13th, 2018 at 11:46 AM.
    Raff, DaveP, Gerta75 and 8 others like this.

  2. #2
    Forum Addict elton williams's Avatar
    Join Date
    December 7, 2010
    Location
    Gold Coast
    Posts
    2,609
    Current Local Time
    09:40 PM
    I've bookmarked the thread you posted on dynamoforum for this, looking forward to doing (trying) it soon. Thanks Thomas!
    johnp likes this.

  3. #3
    Junior Member
    Join Date
    October 14, 2017
    Location
    London
    Posts
    7
    Current Local Time
    12:40 PM
    Thanks Elton, let me know what you think or ask any questions when you get started

  4. #4
    Member
    Join Date
    March 27, 2014
    Posts
    119
    Current Local Time
    12:40 PM
    Same, I have a tab open to remind me to read it when I have some spare time
    johnp likes this.

  5. #5
    Member mjajansen's Avatar
    Join Date
    December 25, 2011
    Location
    The Netherlands
    Posts
    180
    Current Local Time
    11:40 AM
    I have been looking into the api also a little bit, but can someone explain why i would learn C# instead of Python?

  6. #6
    Junior Member
    Join Date
    October 14, 2017
    Location
    London
    Posts
    7
    Current Local Time
    12:40 PM
    Hi Mjajansen

    A similar question was asked on the Dynamo forum, so here's a repost of my response:

    ...Python [is] way more forgiving if you’ve not coded before and just want to have scripting skills you can mix into your day job. Ultimately, knowing both will give you the most flexibility; its important to know that the right tool for the right job also applies with programming languages. Plus, if you learn one, you’ve pretty much learnt the other, at least from a conceptual standpoint. You don’t need C# to access the Revit API either; IronPython is .NET enabled and the syntax for making Revit API calls is practically identical to C# just less verbose (so you could argue, better for getting started). There are some nuances where this rule of thumb doesn’t apply, but they are few and far between.

    The main advantage with C# is the fact you can develop in a full IDE, which is ideal for developing complex programs or solving complex (design?) problems. Paradoxically, its also the ‘easiest’ option for developing by virtue of [features offered by] the IDE, the catch being you need to understand basic comp-sci paradigms and the language of course, before you can do anything useful with it. Python on the other-hand has a reasonable text editor, which can be improved with stubs (which emulates IntelliSense in Visual Studio), but you cant really compare the two as its really just a halfway-house at best.
    To summarise: C# has a more complicated syntax but is better for performance, writing robust code, and developing in an IDE with all the advantages that come with it. Python is a good option as a first language, it's syntax is simpler and cleaner, it handles a lot actions for you (casting etc) and its ideal for prototyping or scripting. However, its dynamically typed which can make debugging (identifying and fixing problems in your code) more difficult and is further exasperated by the lack of an IDE. The good news is, if you learn one, you've pretty much learnt the other, so if you are thinking about getting into to coding, my recommendation is...just start.
    Last edited by Thomas__Mahon; December 12th, 2018 at 03:37 PM.
    mjajansen, Gerta75 and amoursol like this.

Similar Threads

  1. Dynamo at AU - Custom Dimension node
    By Raff in forum Dynamo BIM
    Replies: 13
    Last Post: February 7th, 2018, 06:24 PM
  2. Replies: 0
    Last Post: October 20th, 2017, 01:15 PM
  3. Replies: 0
    Last Post: January 11th, 2016, 06:26 AM
  4. Replies: 0
    Last Post: September 15th, 2015, 12:15 AM
  5. Buildz: NCalc and Dynamo's Formula node
    By Buildz in forum Blog Feeds
    Replies: 0
    Last Post: January 6th, 2014, 01:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •