Video Script - Autodesk Design Academy

advertisement

Parametric Assembly Part I – June 18, 2015

In this lesson we will look at how to reference curves, generate points, and place adaptive components into Dynamo for Revit and Dynamo Studio,. We will also use dynamo to automate the setting of instance parameters for each of the placed families.

To get started we will open the project document included with the datasets for this lesson. This project document contains a set of curves we will reference using Dynamo. But, before we launch Dynamo let’s take a look at how these curves will be used with an adaptive component. From the Revit menu select open family and open the Revit family file located in the datasets folder for this lesson.

This Revit family contains a simple adaptive component that will be used to define floor plate profiles for a tower. The perimeter of the floor plate will also be used to create a building envelope by lofting the edges of this adaptive component.

Select and drag a point to flex the adaptive component. Open the family types interface located in the modify properties tab. Notice that this element contains 2 instance parameters, T1 and T2. Make changes to the instance parameters and hit apply to see the changes update. Load the adaptive component into the project document buy selecting “Load into Project” in the modify tab. Click on the curves to define the adaptive component points. Notice that the points we selected are not co-planar resulting in a triangulated face. Using dynamo we will automate the creation of all required data to more effectively place this adaptive component. Press escape to exit the family placement command.

The project browser now contains the adaptive component and can be accessed via Dynamo. Select the adaptive component and press delete.

Launch Dynamo from the add-ins tab. Once launched, reference the curves from Revit using a “selectmodel-element” node. Since there are 4 curves in the project document let’s copy and paste this node 4 times. Click on the select button to reference a curve in Revit. Repeat this process for the remaining 3 curves. With the curves now selected turn on the background 3D preview to see the selection set in

Dynamo. Make sure to press run to see the background preview.

We will now add a “list-create” node to the workspace and create input ports for each of the reference curves. We will need to intersect a collection of curves with a sequence of XY planes. This will ensure that each of the points we used to define our adaptive components is co-planar. Before we can intersect our model elements with a collection of planes we will need to convert the geometry into data useable by Dynamo. To do this let’s add an “element-curve” node to the workspace. Connect the “listcreate” output to the input “element-curves” node. The collection of planes we will use to intersect the curves will be oriented in the Z-axis and placed vertically according to a number sequence. Let’s add a

“number-node” and a “points-by-components-node” to the workspace. Define the sequence string for the Z-coordinates, X & Y will be defines as 0. I will use the sequence string start, end, and count. Lastly,

I will add an integer slider to define my count value. Connect the output of the “number” node to Z input of the “point-by-coordinate”. Using the rectangle at the bottom right corner of the node, I will click and inspect the output upon pressing run. Making changes to the value specifying “upper” we be

reflected upon pressing run again. You may also change the “integer-slider” controlling the count value and press run to see the results.

Next, let’s add a place by normal node and a vector Z axis to define the plane orientation. Search the library for a vector Z we will see the “vector-create-Z-axis” node. Once again press run to see the result.

To compute the intersection of the element curves and the planes I will search for “intersect-all”. The

“intersect-all” node will take one list input and intersect it with another. A sequence of XY planes will be used to define the geometry input and the “element-curves” will serve as the entity to intersect.

Right click on the “intersect-all” node and change the lacing to cross product. This will ensure that all possible intersections will be computed. Once again, I will use the rectangle at the bottom right corner of the node to inspect the data coming out. In my first list we will see that there is an empty list at the position 0. I will press run again to make sure that it is correctly being computed. Navigating the background preview I will look for any areas where there is not an intersection. By changing the minimal value in my number sequence I can see that pressing run again will result in all intersections being computed.

Now let’s search for the “family-types” node. The “family-types” node will allow me to select a familytype from the open Revit document. Using the drop down I will browse to the dataset that is included with this file. To place this family-type I will search for the “adaptive-component” node. The output port of “family-type” connects to the family symbol input port of the “adaptive-component-by-points”.

But before I connect the output of the “geometry-intersect-all” I need to take a better look at the structure of the data to ensure there is compatibility between the 2 nodes. Currently, the data is structured with 3 levels of hierarchy. This is evident that within the nested list each point has an index of 0. So, the data does not actually correspond to the correct structure required to define the adaptive component points. To modify this data structure I will use a “list-map”. A “list-map” node applies a function over all elements of a list generating a new list from the results. I would like to flatten each sub-list within this nested list in order to be able to have one collection of points for each sub-list.

Connect the output of the “geometry-intersect-all” to list input of “list-map”. Now let’s search for a flatten node. Connect the output of “flatten” to the function input of “list-map”. Click the rectangle at the bottom right corner to compare the results. Here you can see each nested list now contains a collection of points where each index is increasing by 1. We can now use the output of this “list-map” to define the input points of our “adaptive-components-by-points”.

Press run and verify that the definition is correctly automating this task in Revit. In Revit select an instance of the floor plates. Note that this adaptive component contains 2 instance parameters, T1 and

T2.

To modify these parameters per instance we will add an “element-set-parameters-by-name” node to the workspace. This node will take a specified parameter name and quickly allow you to redefine the associated value for each family instance. Connect the output of the adaptive component to the input port element. Using a “string” node I will identify one of the parameters I would like to update.

Connect the output of the string to the parameter name. This parameter name will correspond to the

parameters we saw in the properties of this adaptive component. Using a “number” node I will define a value of 0.25. This value is consistent with what we saw here in the properties palette of the adaptive component we selected. Take the output of the “number” node and connect it to the input port value.

Press run to see the results update in Revit. Note that because we have not made changes to the value which is consistent with what we saw in the properties palette the updates will not be changing. Let’s change this value to 0.3 and press run again. In doing so we will see that now each of the plates is changing. To define a unique parameter value per instance I will use a remap node to remap the current

Z-coordinates to domains between 0.2 and 0.3. Search for remap in the library and add the “remaprange” node to the workspace. Using the sequence that defines our Z we can connect the current value in numbers and define a new min and new max using a “number” node. For the min I will define 0.2 and for the max 0.3. Replace the input value with the output of “remap-range”.

Press run to see the result. Notice, as we make changes to the curves in Revit, if we press run again in

Dynamo the definition will update.

Download