20140120
Dynamo Stadium
We've done a few Dynamo demo's using a Stadium dataset that Nate Miller started back this past fall and we have been tinkering with it ever since. It's a work in progress, and I'm sure we will keep refining it, but there are a number of nice things going on that folks can learn from now. You can see the file in action during the first few minutes of this presentation.
Download the Datasets.
Riser layout: there are some well tested methods for laying out stadium seating, a recursive method that starts with the person sitting in the front row, with each successive riser placed such that the next person can see over the head of the person in front. In this Dynamo file, it is handled with a tiny Python node.
Placing families: There is a boolean toggle to turn Revit family creation on and off. This is helpful if you are looking to experiment with the general structure of the Stadium while not having to commit to the performance hit of Revit family creation.
Visualization of downstream effects: There are a number of input parameters that are nice to see the isolated effects of. We placed a few watch 3d nodes so that you can monkey with the basic layout parameters and see the effects further downstream on specific structures: Risers, Trusses, Enclosure.
You can run the definition in either a mass.rfa, or in a regular .rvt environment, but you need to have the Truss, Riser, and Panel families loaded, as well as specify a sun setting for the file. Color Overrides will only work in the rvt environment. There is also a "custom node" in this definition that you need to download from the Package Manager. Is the menu bar at the top of the application go to Packages>search for a package> and search for "Quads from Rectangular Grid", then re-open Stadium.dyn
There will surely be updates to this in the future, but this can get folks going.
Download the Datasets.
20140113
Dynamo: Writing data to text files
There's been some recent discussion about how to write geometric data out to external data sources. Here is the most basic on both ends: xyz coordinates written to a .txt file.
Of course, you may want to do some fine tuning of this kind of thing. Here is a version that cleans up the data, reducing significant digits and other formating.
Resulting in this .txt file.
There are surely a number of ways to do similar things.
A couple things to note here:
1. XYZ's are Containers, that is, they are a specific kind of chunk of computational stuff that is not automatically recognized as a series of numerical element or strings. They need to be decomposed to something consumable by a text file if that is what you are writing to. "To String" is the simplest way to do this, but there are other methods to create more fine tuned data.
2. You need to format your data for your consuming file format. Writing to a text file, you need to add commas, carriage returns, or other pertinent delimiters. In the "Joing Strings" node, the "del" or delimeter that is being added is a carriage return, this basically says "return" after every line of x,y,z that comes across
3. you can add all sorts of other data to this. For String processessing, just enter "string" in the search bar and take a look at some of the tools that are available.
Don't forget to also take a look at a couple other examples in the Help>Samples>23 Data Import and Export, for tips on how to write to Excel. There are also explanations in the pdf tutorial.
Thanks to the folks who participated in this discussion over on the Vasari Forum.
20140109
Dynamo Webinar, 2 parts, European time
Andrzej Samsonowicz, Autodesk Applications Engineer, is presenting a 2 part Dynamo webinar, free and open to the public. Register now, as there are a limited number of seats (and PLEASE only register if you think you are really going to make it!)
Dynamo
on Revit. The super addin. Part I. General overview.
|
|||||||||||||||||||||||||||||||||||||
|
20140105
NCalc and Dynamo's Formula node
You WILL love the formula node in Dynamo. Resistance is useless.
The Formula node is a beautiful thing. Once you get the hang of how it works, it will replace a number of other nodes. Lots of folks think that you use it for doing fancy calculations with fancy names like "logarithm" or "law curve", but it's got all sorts of other banal uses. Driving the Formula node's excellent operations is NCalc, "a mathematical expressions evaluator in .NET. NCalc can parse any expression and evaluate the result, including static or dynamic parameters and custom functions". The full description of the project can be found here.
As a non-text based programmer, the Formula node is my gateway drug to "real programming" (oooh, scary) because it's like dipping your toes in the deep and churning waters of traditional coding without having to plunge in up to your naughty bits.
For instance, let's say you were going to add 3 numbers, 1+2+3. You COULD do this with the big friendly looking Add nodes:
But, my goodness that looks clumsy. How about this instead?
Ah, much tidier, and the math syntax is recognizable to any 2nd grader.
OK, something a little more involved.
Or stuff that isn't necessarily an equation, like an IF/THEN statement that makes sure an output does not fall below a threshold:
Here the formula node is not only more legible, it actually becomes more powerful than the dedicated nodes, because it can handle lists of numbers much more easily.
Once you get into the logic and syntax (and visit the NCalc site to understand all the built in functions) you can go hog-wild.
(You know, "hog-wild" in the way that only someone sitting alone at a computer talking about math on a Sunday night with a shot of bourbon can . . .)
Examples of some other things you can do with the formula node can be found here:
- Page 28 of Dynamo Visual Programming for Design
and here
and most importantly, http://ncalc.codeplex.com/
You WILL love the formula node in Dynamo. Resistance is useless.
The Formula node is a beautiful thing. Once you get the hang of how it works, it will replace a number of other nodes. Lots of folks think that you use it for doing fancy calculations with fancy names like "logarithm" or "law curve", but it's got all sorts of other banal uses. Driving the Formula node's excellent operations is NCalc, "a mathematical expressions evaluator in .NET. NCalc can parse any expression and evaluate the result, including static or dynamic parameters and custom functions". The full description of the project can be found here.
As a non-text based programmer, the Formula node is my gateway drug to "real programming" (oooh, scary) because it's like dipping your toes in the deep and churning waters of traditional coding without having to plunge in up to your naughty bits.
For instance, let's say you were going to add 3 numbers, 1+2+3. You COULD do this with the big friendly looking Add nodes:
But, my goodness that looks clumsy. How about this instead?
Ah, much tidier, and the math syntax is recognizable to any 2nd grader.
OK, something a little more involved.
Or stuff that isn't necessarily an equation, like an IF/THEN statement that makes sure an output does not fall below a threshold:
(for more on how that sequence of numbers is made, go here)
Once you get into the logic and syntax (and visit the NCalc site to understand all the built in functions) you can go hog-wild.
(You know, "hog-wild" in the way that only someone sitting alone at a computer talking about math on a Sunday night with a shot of bourbon can . . .)
Examples of some other things you can do with the formula node can be found here:
- Page 28 of Dynamo Visual Programming for Design
and here
and most importantly, http://ncalc.codeplex.com/
You WILL love the formula node in Dynamo. Resistance is useless.
Subscribe to:
Posts (Atom)