By Dennis Collin
Dynamo is a platform for Visual Programming. Visual Programming makes it easy for architects and engineers who are not programmers to begin exploring creative workflows. Dynamo also enables users to achieve tasks that are either not possible or too time consuming to do.
To achieve these tasks a graph script needs to be created, comprising of nodes and connecting wires to process lists of data and then apply modified data back to a series of element parameters or export to Excel or other programs.
As with any programming tool there is usually a number of ways to achieve a given task. Dynamo node elements are no exception. There is often a need to process elements like a list or numbers and these numbers can be created in several ways. Many users employ Number and Number Slider nodes, the former specifies a specific value, the latter permits a user to dynamically adjust the number between a minimum and maximum value with a specified step. For a list of numbers Sequence and Range Nodes can be used with similar start, end, number or stepping options.
All nodes can be found via the Node Search tool and then these nodes can be wired to other nodes to view, modify, filter or process data. An alternative method to generate numbers is the general purpose, Codeblock node. Although perhaps more complex to use, it can reduce the number of nodes in the script and make the whole graph look visually simpler.
To summarise, a Codeblock node can generate a series of number in many ways, by placing the ~ (symbol) or # (hash) before the 2nd or 3rd digit can produce a different series of sequential values. Refer to the image below:
- Start..End – A bounded range of numbers (assumed interval of 1, end value included)
- Start..End..Step – A bounded range of numbers with step .. End of Sequence, Interval of 3 (ending value may not be included in output)
- Start..End..#Items – A bounded range of a given number of items
- Start..#Items..Step – A sequence with step and number of items
- Start..End..~Step – A bounded range with an approximate step (values evenly distributed, including end value
In a future post we will look deeper into the Codeblock node and how they be used to work with more complex lists.
Hozzászólások (0 hozzászólás)