Math.RemapRange scales attractor distances to suitable dimensions for curtain panel components; dimensions are written to Revit panel fin depths.
- [Instructor] So far, we've gathered a list of distances from each curtain panel on our feature wall to the attractor point. These distances vary from as little as 20 feet all the way to 62 feet. If we were to feed this list of numbers directly into our fin depth parameter, we'd have some outrageously long fins on our curtain wall. In this next step, we're going to take our list of distances and scale them down to a range of dimensions that are suitable for parts of a curtain panel assembly. I'd like to introduce a node called remap range, which we can find in the core math section of the node library.
This node will take our list of distances and allows us to scale all of the numbers in the list according to a new minimum number and a new maximum number that we'll set. So for our fin depth example, let's say we want the shortest fin to extend three inches forward of the face of glass. And we want the largest fin, the deepest fin to extend two feet outward. Dynamo's reporting distances to us in feet, so let's remap this range of distances with a new minimum as 0.25, because three inches is a quarter of a foot, and our new maximum output as the number two.
When we look at the node preview, we can see that all of our numbers have been reduced to fit within the range of 0.25 to two. Now that our distances have been scaled back to appropriate lengths of curtain panel elements, let's apply these dimensions to our curtain panels in Revit. I'll search for the set parameter by name node and drop one on to the workspace. Since we're about to have Dynamo write changes to the Revit file, I'm going to change my execution bar setting to manual. We can go ahead and plug our list of curtain panel dimensions into the value input. To the far left side of the graph, we also have our list of curtain panel family instances ready to connect to the element input, but remember, we don't want to use any of the curtain panels that yielded null values here.
That's why we went through this filtering exercise in the first step of the workflow. We want to get the list coming from the out output of our filter by boolean mass node, which contains a reliable set of curtain panel family instances and plug that into the element input of our set parameter node. And last, we'll add a code block here to provide a string with the name of the parameter, which is fin depth. Before I click run, I like to put my Revit and Dynamo windows side by side again, so we can watch the curtain panel geometry update. I also would like to turn off the Revit background preview since we're now seeing a line drawn between every panel in the attractor, which is pretty distracting.
Okay, I'm ready to click run. After the script runs, we can see that all of the fins now have a slightly different dimension based on how close they are to the attractor point. Panels that are closer to the point have smaller fins, while the panels that are farther away from the attractor point have deeper fins. Of course, we can always move our attractor point and update the Revit geometry, but because I'm in manual execution mode instead of automatic, Dynamo doesn't show me the arrows to click and drag the attractor point to a new location. I could switch the setting back to automatic, but then each time I move the attractor point's location, I'll need to wait while Dynamo pushes all of the new parameter data to Revit before I can make another adjustment.
What I'll do is use the freeze node feature, which allows a workflow to run but ignores certain nodes if they're set to frozen. In my graph view, I'll right click on the set parameter node and select freeze. We can tell that the node is frozen because it becomes partially transparent. Now I can switch my execution bar setting to automatic, and the entire graph will recalculate, except for the node that sends parameter data to Revit because it's frozen. Now I can safely switch back over to the geometry view and adjust my attractor point's location visually. When I'm happy with the point's location and I'm ready to update my curtain panel parameter values again, I can change my execution bar setting back to manual and unfreeze the node by right clicking on it and deselecting freeze.
Now I'll put my windows side by side again and click run. And the fin depths change again relative to the new attractor point location. So to recap our workflow, we had Dynamo find each instance of curtain panel family type and then we extracted a point along each panel's boundary curve to act as the panel's origin. Then we measured the distance from each point to a single attractor point, which we then used to set each panel's fin depth parameter. If we were to share this Dynamo script with another designer in the office, it might be a little more user friendly to use number sliders instead of code blocks for inputs that you might want them to have easy access to.
In particular, I'm thinking about these minimum and maximum fin depth dimensions. Those are dimensions that you might want to give others an easy ability to control, in addition to the location of the attractor point.
- Renumbering rooms by their building level
- Reading Revit element data with Dynamo
- Setting Revit parameter values
- Calculating occupant loads
- Analyzing room layouts
- Interpreting Revit geometry and curtain panel boundaries
- Generating architectural patterns based on random numbers