Sunday, April 20, 2014

Visual Programming Using Revit-Dynamo

PROJECT 2 – ARCH 653




Fig 1. Building Facade



DESCRIPTION:

For project 2, we were to extend the level of functionality and creativity of the BIM model that was created in the first project. For these applications, the use of Visual Programming i.e., Revit Dynamo has become essential. As the projects get more complex, it is not possible to control all the parameters in the modelling interface.

I have chosen the same building model that I had used for project 1, on which I first ran this test process of controlling the parameters. Later, I also tried using this Dynamo file on other different shapes to see if a new parameter had to be included, but it was not necessary.

This time I have used Octagonal curtain panels with a circular void form in them. The aim of my project is to control the size of those openings using the colors of the panels. Apart from my building model, I have used the same dynamo file at various places to show a few more examples.

My curtain panels are ‘Octagonal’ Curtain Panels by pattern shown in fig., which are created with a thickness of 1 feet. A circular void is cut at the center of that curtain panel with a particular radius, which I named as the “Opening radius”. At the end of this project, the change in color, changes the radius of the opening. The change in radius is specified by us in the Dynamo coding.



      Fig 2. Octagonal Curtain Panel
 


RANDOMIZING USING EXCEL:

After applying the curtain panels on the divided surface, it is time to change the color of the panels with Dynamo. In order to randomize the color of the panels, I have used an Excel sheet with the function “RANDBETWEEN” to alternate the panels with 5 different colors. This function updates the sheet with random display of numbers from ‘0 to 4’. These numbers should vary in a specific number of cells, equal to the number of panels in the divided surface of the building.

Fig 3. the random values from Excel sheet

                                     
EXPLANATION FOR THE DYNAMO CODE:

The Dynamo code has a lot of nodes, which if sequentially laid, makes a proper code. Dynamo tool is pretty recent and so it does not have all the nodes, which can be normally done in a revit environment. If the user does not know what node to use, this process would not be productive. This does not make it easier for the user to use Dynamo and can be considered as the critics during the growing stages of Dynamo.
The following is the Dynamo code used for my project.

       Fig 4. Dynamo code for random colors controlling size of openings and thickness

There are 4 things that we need to get from the Revit Interface when using Dynamo:

  1. The Divided Surface
  2. Parameter 1 - Material/Color of object
  3. Parameter 2 - Opening
  4. Parameter 3 - Thickness       



                    Fig 5. Dynamo code- Divided Surface Families Node
 
The ‘Select divided surface Families’ Node is used to select the divided surfaces from the Revit Environment. The ‘Watch’ node connected to it shows all the selected panel by the IDs and the shape of the panel selected is also mentioned in the list of lists. This list is flattened into one list with the help of ‘Flatten Completely’ node. Multiple surface can also be selected using many instances of this node and then grouping them. However, using this node multiple times to select different surfaces on objects might pose a task, as the process can be complicated.

Fig 6. List Node for Materials/Colors

 
There are more than one material color and more than 1 radius values, so a ‘list’ option is used to group them individually.

Fig 7. list node for values of Openings and Thickness

Since my model has many divided surfaces, all the lists of panels are put through a ‘flatten completely’ node, so that all the panels are put under just a single list, which is then plugged into the final node ‘Set Element Parameter’. This parameter actually shows the result in the actual Revit mass family.

Python Script: This is also used in the Dynamo code, instead of many ‘if-else’ nodes. The python script comes in handy as a big If-else statement. This script basically takes one color as input, based on which a radius value and a thickness value is selected. These are automatically changed if the chosen color changes. 

For example if the Material color is Glass, corresponding radius for the opening is 4 ft and thickness is 3 ft. And if the color is 'Default- Blue', corresponding radius for the opening is 2 ft and thickness is 4 ft.

Without the python script, this would be make the Dynamo screen look too clustered with a lot of nodes. Hence a python script is used to simplify this process.

The Excel file controls the randomness of the colors, the list of material colors and the list of radius values are given as Input to the Python Script node.
Simultaneously there is another python script in the Dynamo code, which helps in changing the value of the thickness of the curtain panels based on the value of the colors.


FINAL FAƇADE AND EXAMPLES:

Below are few examples of models that I have created with the curtain panels changing in every picture that is shown. The figures below shows obviously the different colors, thickness and changing opening sizes.


L-shaped building
Sphere
Crescent
Star

Colorful Chessboard





                    Video also found at :     http://www.youtube.com/watch?v=wblfaCwKLEk