Select a few nodes from the node library, discuss the anatomy of a node (inputs, outputs, node preview) and cover the picks-and-clicks required to connect and disconnect one node's output to another node's input. A single node output may be connected to multiple other nodes' inputs, but only one wire is ever allowed into a single input.
- [Voiceover] Now we're ready to start placing nodes onto our workspace and connecting them together. Each node has one job, it takes one or more inputs, performs a very specific function or process with those inputs, and then it spits out an output on the other end. I'll start off in the operators library which has several nodes that are used for mathematical operations. I'll begin by clicking on the addition node which we'll use to add two numbers together. This will drop one addition node onto the workspace. The light gray boxes with text on the node are inputs and outputs.
These are the ports that you use to connect nodes together with wires. Inputs are in the left, and outputs are on the right. It appears that the addition node takes two inputs called x and y. Let's head over to the node library and find a node that will allow us to feed numbers into the addition node's inputs. I'll navigate to the core input section of the node library and find the number node. Because we need two number inputs for the addition node, I'll click twice to place two instances. Now let's talk about arranging your nodes on the workspace. To move a node, hover over the header or the body of the node, not on an input or an output and hold down the left-click button on your mouse.
While holding the left-click, you can move your cursor to drag the node to a new location. You can also zoom in and out of your workspace by using the scroll wheel on your mouse. Holding down the middle mouse button, or the scroll wheel, will also allow you to pan around the workspace. While our workspace is only three nodes right now, you'll see that a Dynamo graph can get pretty expansive pretty quickly. Using these tools will help you navigate more efficiently. We can set the value of the number that we're going to us as an input by clicking on the box that displays a zero right now and typing in whatever number we'd like.
I'll change the first number input to a 1, and the second number input to a 2. To connect a node's output to another node's input with a wire, single click on the node's output and a wire will be created and follow your cursor. Single click on another node's input to connect them. I'm going to go ahead and connect both of our numbers to the addition node's inputs. Notice that when a node's inputs have all been filled, the header turns from a light gray to a dark gray. This means that the node is collecting all the data that it needs to perform it's function. In order to disconnect an input, you can click on the input and then click off in space.
Also note that a node's output can connect to multiple inputs. I can plug the same number node into both the x and the y inputs of the addition node. We're now passing the same number, number one, to both inputs, however inputs only take one wire at a time. If I try to plug our other input node into the y input, it automatically disconnects the wire that was already there. Now let's see the data coming out of the node. We can do this in one of two ways. One way is to connect the node's input to a watch node. We can find a watch node in the core view section of the node library.
When I connect the addition node to the input of our watch node, you can see that the watch reports the number of three, which means our addition node is doing it's job. It's taking the number one as the x-input, two as the y-input, and it's adding those two together, one plus two equals three. Think of the watch node as a display that reports whatever information is coming into it. Another way to see the data coming out of a node is to hover over the body of the node, which pulls down a small white window that reports the output. If I move my cursor away, it collapses back into the node. If we'd like the node preview to remain visible, we can click on the pin icon.
Next, let's drop in a node that will construct some geometry. I'll navigate to the geometry library. Maybe we'll build a cylinder so I'll click the cylinder category. When I drop this node in a few things happened. First of all, a cylinder is now drawn in the background of our workspace. This is called the geometry 3D preview. Anytime you're working with geometry, you can preview the work you're doing here. To navigate the 3D preview, we can click the button in the top right corner of our workspace and toggle between graph navigation and 3D preview navigation. Clicking it will make our nodes transparent so we can focus on the geometry in the preview.
The navigation here is similar to navigating the graph. Scroll wheel zooms in and out, and you can pan by holding down the middle mouse or scroll wheel button. To rotate, hold down the right-click button of your mouse and move your cursor. Clicking the graph navigation button in the top right will bring us back to the graph workspace. If we hover over an input on the cylinder node, we see that it's able to run without any inputs plugged in because it has a default value set. We can plug in any of the number data in our workspace to customize the cylinder.
In another video, we'll cover the topic of data types in more detail, but let's see what happens when we plug in the wrong type of data into a nodes input. If we hover over the CS input on the cylinder node, the preview tells us that the node expects a specific type of geometry data called a CoordinateSystem. Let's see what happens when we plug one of our numbers into it. When the node isn't fed the right type of data it turns yellow and returns an error message which you can read by hovering over the bubble icon. Removing the wrong data type from the input clears the error, and the node goes back to a gray color again.
Okay, we've covered the basics of placing and connecting nodes. Let's begin working in Dynamo.
- Placing and connecting Dynamo nodes
- Understanding Dynamo's data types
- Performing math functions
- Creating number lists and text strings
- Writing data to an Excel spreadsheet
- Creating points, curves, surfaces, and solids
- Analyzing geometry
- Linking a Dynamo-driven SAT into Revit
- Placing Revit families with Dynamo
- Creating Revit views and sheets with Dynamo