Dynamo
Primer for v2.0
English
English
  • About
  • Introduction
    • What is Dynamo & How Does It Work?
    • Primer User Guide, Dynamo Community & Platform
  • Setup for Dynamo
  • User Interface
    • Workspace
    • Library
  • Nodes and Wires
  • Essential Nodes & Concepts
    • Index of Nodes
    • Geometry for Computational Design
      • Geometry Overview
      • Vector, Plane & Coordinate System
      • Points
      • Curves
      • Surfaces
      • Solids
      • Meshes
    • The Building Blocks of Programs
      • Data
      • Math
      • Logic
      • Strings
      • Color
    • Designing with Lists
      • What's a List
      • Working with Lists
      • Lists of Lists
      • n-Dimensional Lists
    • Dictionaries in Dynamo
      • What is a Dictionary
      • Dictionary Nodes
      • Dictionaries in Code Blocks
      • Revit Use-Cases
  • Custom Nodes & Packages
    • Custom Nodes
      • Custom Node Introduction
      • Creating a Custom Node
      • Publishing to Your Library
    • Packages
      • Package Introduction
      • Package Case Study - Mesh Toolkit
      • Developing a Package
      • Publishing a Package
      • Zero-Touch Importing
  • Dynamo for Revit
    • The Revit Connection
    • Selecting
    • Editing
    • Creating
    • Customizing
    • Documenting
  • Dynamo for Civil 3D
    • The Civil 3D Connection
    • Getting Started
    • Node Library
    • Sample Workflows
      • Roads
        • Light Pole Placement
      • Land
        • Service Placement
      • Utilities
        • Rename Structures
      • Rail
        • Clearance Envelope
      • Surveying
        • Point Group Management
    • Advanced Topics
      • Object Binding
      • Python and Civil 3D
    • Dynamo Player
    • Useful Packages
    • Resources
  • Dynamo in Forma Beta
    • Set Up Dynamo Player in Forma
    • Add and Share Graphs in Dynamo Player
    • Run Graphs in Dynamo Player
    • Dynamo compute service differences with Desktop Dynamo
  • Coding in Dynamo
    • Code Blocks and DesignScript
      • What's a Code Block
      • DesignScript Syntax
      • Shorthand
      • Functions
    • Geometry with DesignScript
      • DesignScript Geometry Basics
      • Geometric Primitives
      • Vector Math
      • Curves: Interpolated and Control Points
      • Translation, Rotation, and Other Transformations
      • Surfaces: Interpolated, Control Points, Loft, Revolve
      • Geometric Parameterization
      • Intersection and Trim
      • Geometric Booleans
      • Python Point Generators
    • Python
      • Python Nodes
      • Python and Revit
      • Setup Your Own Python Template
    • Language Changes
  • Best Practices
    • Graph Strategies
    • Scripting Strategies
    • Scripting Reference
    • Managing Your Program
    • Efficiently Working With Large Data Sets In Dynamo
  • Sample Workflows
    • Getting Started Workflows
      • Parametric Vase
      • Attractor Points
    • Concept Index
  • Developer Primer
    • Build Dynamo from Source
      • Build DynamoRevit from Source
      • Managing and Updating Dependencies in Dynamo
    • Developing for Dynamo
      • Getting Started
      • Zero-Touch Case Study - Grid Node
      • Executing Python Scripts in Zero-Touch Nodes (C#)
      • Going Further with Zero-Touch
      • Advanced Dynamo Node Customization
      • Using COM (interop) types in Dynamo Packages
      • NodeModel Case Study - Custom UI
      • Updating your Packages and Dynamo Libraries for Dynamo 2.x
      • Updating your Packages and Dynamo Libraries for Dynamo 3.x
      • Extensions
      • Defining Custom Package Organization for Dynamo 2.0+
      • Dynamo Command Line Interface
      • Dynamo Integration
      • Developing For Dynamo For Revit
      • Publish a Package
      • Build a Package from Visual Studio
      • Extensions as Packages
    • Pull Requests
    • Testing Expectations
    • Examples
  • Appendix
    • Frequently Asked Questions
    • Visual Programming and Dynamo
    • Resources
    • Release Notes
    • Useful Packages
    • Example Files
    • Host Integration Map
    • Download PDF
    • Dynamo Keyboard Shortcuts
Powered by GitBook
On this page
  • What are my options?
  • For Dynamo
  • In Dynamo
  • What are the advantages/disadvantages of each?
  • Understanding Dynamo versioning and API changes (1.x → 2.x)
  • Permission to distribute binaries in a package
  • Dynamo UI Performance Considerations
Edit on GitHub
Export as PDF
  1. Developer Primer

Developing for Dynamo

PreviousManaging and Updating Dependencies in DynamoNextGetting Started

Last updated 3 months ago

Regardless of experience level, the Dynamo platform is designed for all users to be contributors. There are several development options that target different abilities and skill levels, each with its strengths and weaknesses depending on the goal. Below we will outline the different options and how to choose one over another.

Three development environments: Visual Studio, Python Editor, and Code Block DesignScript

What are my options?

Development options for Dynamo fall primarily into two categories: for Dynamo versus in Dynamo. The two categories can be thought about as; "in" Dynamo implies content that is created using the Dynamo IDE to be used in Dynamo, and "for" Dynamo implies using external tools to create content to be imported into Dynamo to be used. Though this guide is focused on development for Dynamo, resources for all processes are described below.

For Dynamo

These nodes allow for the highest degree of customization. Many packages are built with this method, and it is necessary for contributing to Dynamo's source. The process of building them will be covered in this guide.

  • Zero-Touch Nodes

  • NodeModel derived Nodes

  • Extensions

For the discussion below Visual Studio is used as the development environment for Zero-Touch and NodeModel nodes.

The Visual Studio interface with a project that we will be developing

In Dynamo

  • Code Blocks expose DesignScript in the visual programming environment, allowing for flexible text-script and node workflows. A function in a code block can be called by anything in the workspace.

  • Custom Nodes are containers for collections of nodes or even entire graphs. They are an effective way to collect frequently used routines and share them with the community.

  • Python Nodes are a scripting interface in the visual programming workspace, similar to code blocks. The Autodesk.DesignScript libraries use a dot notation similar to DesignScript.

Developing in the Dynamo workspace is a powerful tool for getting immediate feedback.

Developing in the Dynamo workspace with the Python Node

What are the advantages/disadvantages of each?

Development options for Dynamo have been designed to address the complexity of a customization need. Whether the goal is to write a recursive script in Python or build an entirely custom node UI, there are options for implementing code that involve only what's necessary to get up and running.

Code Blocks, the Python Node and Custom Nodes in Dynamo

These are straightforward options for writing code in the Dynamo visual programming environment. The Dynamo visual programming workspace provides access to Python, DesignScript, and the ability to contain multiple nodes inside of a Custom Node.

With these methods we can:

  • Get started writing Python or DesignScript with little to no setup.

  • Import Python libraries into Dynamo.

  • Share Code Blocks, Python Nodes, and Custom Nodes with the Dynamo community as part of a package.

Zero-Touch Nodes

Zero-Touch refers to a simple point-and-click method for importing C# libraries. Dynamo will read the public methods of a .dll and convert them to Dynamo nodes. You can use Zero-Touch to develop your own custom nodes and packages.

With this method we can:

  • Write C# methods and easily use the methods as nodes in Dynamo

  • Share a C# library as nodes with the Dynamo community in a package

NodeModel derived Nodes

These nodes are a step deeper into the structure of Dynamo. They are based on the NodeModel class and written in C#. While this method provides the most flexibility and power, most aspects of the node have to be explicitly defined and functions need to live in a separate assembly.

With this method we can:

  • Create fully a customizable node UI with sliders, images, color, etc (e.g. ColorRange node)

  • Access and affect what's happening in the Dynamo canvas

  • Customize lacing

  • Load into Dynamo as a package

Understanding Dynamo versioning and API changes (1.x → 2.x)

Since Dynamo is being regularly updated, changes might be made to part of the API that a package uses. Tracking these changes is important to ensure that existing packages continue to work properly.

Permission to distribute binaries in a package

Be aware of .dll's included in a package being uploaded to the package manager. If the package author did not create the .dll, they must have the rights to share it.

If a package includes binaries, users must be prompted upon downloading that the package contains binaries.

Dynamo UI Performance Considerations

At the time of writing, Dynamo primarily uses WPF (windows presentation foundation) to render its UI. WPF is a complex and powerful xaml/binding based system. Because Dynamo has a complex UI, it's easy to create UI hangs, memory leaks, or wrap the graph execution and UI updates together in ways that degrade performance.

The Primer has a guide on .

Though these processes exist in the visual programming workspace and are relatively straight forward, they are all viable options for customizing Dynamo. The Primer covers these extensively and provides scripting tips and best practices in the chapter.

Download a Code Block example (Right-click and save as) or see a detailed walk-through in the .

Download a Custom Node example (Right-click and save as) or see a detailed walk-through in the .

Download a Python Node example (Right-click and save as) or see a detailed walk-through in the

Import a library which was not necessarily developed for Dynamo and automatically create a suite of new nodes, such as the in the Primer

API changes are tracked on the . This covers changes to DynamoCore, Libraries, and Workspaces.

An example of an upcoming, significant change is the transition from XML to JSON file format in version 2.0. NodeModel derived nodes will now need a otherwise they won't open in Dynamo 2.0.

Dynamo's API documentation currently covers the core functionality:

Please refer to the which will help you avoid a few common pitfalls making changes to Dynamo's code.

importing Zero-Touch libraries
Scripting Strategies
Primer
Primer
Primer
Dynamo Github Wiki
JSON constructor
http://dynamods.github.io/DynamoAPI
Dynamo Performance Considerations Wiki Page
A-Forge example
Three development environments
Visual Studio interface
Developing in the Dynamo workspace with the Python node
Code block, Python script, and custom node
Zero-touch nodes
NodeModel derived nodes
Dynamo API changes document
API documentation