Wednesday, April 27, 2011

Project 2 ARCH653 Revit API - Parametric Design

This project has been designed in four steps:

1) Developing BIM model of Town Hall Building of Alvar Aalto in Revit Autodesk
2) Designing parametric model of fan-shaped truss of the chamber of this building using Revit Interface
3) Developing parametric model of mass of the chamber, fan-shaped truss, and the roof of the chamber using Revit API
4) Developing 4 dimensional model of this project using Navisworks Manager

Figure 1

I have talked about the first two steps in the previous post, so I will discuss the two remaining steps in this post.

Figure 2

As we know in order access the parameters of a model which is parametrically designed in a project we have to use API programming. Therefor in this part of this project we have tried to learn how to control parameters using Revit API.

Figure 3-7 shows how the API program works in this project. After running the TownHallBuilding.dll file through Revit AdsInn, a windows application window pops up and asks about the desired roof angle for the chamber of this building.


When the user enters the angle to the project, another window pops up and shows the angle that the user has entered and double check it before making any changes to the project.


If the user confirms the angle, the API program will set the new angle to the roof of the chamber, the mass of the chamber, and two trusses that are placed under the roof of the chamber.


Figures 6 and 7 show a section of the same model with the same changes using section box.



The  API code which is developed by C# has 7 main parts:

1)            Declaring Global Variables:

I have defined the roof angle as  global variable. The only issue here was the change of units. Therefore I had to convert the value of the angle which was defined by degree in my parametric design and windows application form interface to radian. This could be done using the following formula:

Angle(Radian) =  Angle Degree * π /180

2)                Initializing and starting transaction with Revit


      3)          Getting objects from project:
Four objects have been accessed from the project. The mass of the chamber which has been used to make walls and roof of the chamber. The two fan-shaped trusses that have been located bellow the roof of the chamber. The roof of the chamber which the walls of the chamber have been joined to it.

      4)        Getting the parameters of objects:

The angle parameter of all of the above-mentioned objects are obtained form project in these lines of codes.

      5)        Getting values of the parameters


      6)        Setting the new values of the parameters of objects

Using windows application form, the user can insert desired angle for the roof of the chamber which is used to update the the values of the parameters.  The angle of the mass of the chamber, roof of the chamber, and angle of the two trusses will be update in these lines of codes.

      7)        Commit the transaction and terminating the API program

Problems and Challenges:

I have faced a problem in positioning the two trusses. It was a little strange that each time I have tried to change the location of trusses and then run the API program, the trusses have moved to an unknown location and the base plate of truss members has been separated (as shown in figure 11). In order to deal with this problem each time I had to go to all families and edit the family and upload it again to the project. I have checked the process of  developing the family members and the truss many times, but I could not solve the problem. Please go ahead and post any idea you have to solve this problem.


Figure 12

In the video 1, you can find more information about the Town Hall Building and about the process of making the 3D model, parametric model, and using API to control the variables. Also at the end of the movie the 4D model of this project is displayed.

Wednesday, March 23, 2011

Project 1 ARCH 653

In project 1, I have tried to model the Town Hall building by Revit and develop a parametric model of a complex part of the building. This building is designed by Alvar Aalto and located in Saynatsalo, Finland.

This building is a municipal building to serve the expanding community. The building is constructed by restrained palette of natural materials- mainly brick, stone, wood and copper- and structurally, the building is straight forward with reinforced concrete columns, floor slabs and ceilings.

I have used Revit Architecture 2011 for developing the model. During the project, I have sensed that learning how to use Revit follows a sharp learning curve. On the other hand, if one uses this software correctly, it will significantly help to create a BIM model.

Figure 1

As the first step of this project, I have worked on the site of the project, levels and gridlines. In this step levels of different parts of the jobsite were calculated and inserted in the topography. I had to deal with two challenges. First, the lack of data on elevation of different points (which was the same case for other steps of the project). The second problem was related to Revit. The interpolation of the elevation of the topography of the job site was not proper some times and needs lots of manual interaction to make it as desired. This approach is time consuming, difficult, and in some cases the desired situation could not be achieved at all. Figure 2 shows the case in which the top surface does not match the required design of the grass steps up to the courtyard. I have spent 4 hours to change the topography manually to match the required elevation; however, it still has some un-leveled parts on these steps.

Figure 2

In the second phase of the project, I have worked on building pads and sub-regions of the project to show the roads and site area and location. Some of the adjacent buildings are shown by mass in the model which can be seen in figure 3 as well. 

In the second phase of the project, I have worked on building pads and sub-regions of the project to show the roads and site area and location. Some of the adjacent buildings are shown by mass in the model which can be seen in figure 3 as well. 

Since the parametric modeling part that I have chosen was very complicated; in the project I have just modeled the council chamber Town Hall building. This part has complicated plans, sections and components that can make a good project.

I can mention these challenging parts in my project:

   1. The 3rd floor of council chamber walls need roof

I had to use mass to model this part of the building. In order to develop the mass, I used 4 different forms and adjust them to get the desired shape. 

   2.  The huge window in the council chamber

I have modified the closest window family to make this window. After regenerating the model and uploading it, I have decided to add the shading part to it. I have sketched the window but whenever I tried to upload it, the Revit went frozen and showed errors. Image of this window is shown in Figure 3.

Figure 3

   3. Council chamber furniture

Because the limitations of furniture family in Revit, I had to make most of the furniture in council chamber from the scratch such as

     -    Corner benches (parametrized)
     -    Bench (parametrized)
     -    Chairs
     -    Window

Figure 4

For parametric modeling, I have chosen the roof truss of council chamber. This truss is designed to enable the primary and secondary beams to run in the same direction.

First I have tried to prepare a mass family for each member  of truss which were made length and different angles for the member and bottom and top sections. But I could not make parametric model by that design.

So I had to change my approach. So I have used two dots and defined x, y, and z parameters for each of them. Then I have connected these two dots with a line of adaptive mass. Using this line, I have added the form to the model. Using this form, I could be able to make the truss using very simple formulas. I have used this member in 3 different types to make the truss.

In this model I had one variable; the roof angle. You can see all the formulas which are calculated based on this variable and a constant, which is room dimension.

 Figure 5

Figure 6

In another try, I have developed a model to change both room with and  roof angle. But there are some errors in this model because of the cycle in the formulas. I will improve these models in later steps.

Figure 7

 Figure 8