BIM-Project2-API application on Eden Project Modeling

 
BIM-Project2-API application on Eden Project Modeling

Introduction

Building Information modeling is a powerful tool for different parities including the owner, architectures, engineers, and contractors. Information can be transferred more accurately, fast, and completely by using BIM technology. Autodest Revit is typical and wide-used software for utilizing BIM. Revit Architecture is one member of Revit big family. It allows users to design a model in 3D, and apply materials to different component of the model. By using parameter design, and API tools, Revit Architecture is able to offer multiple designs in a very efficient way according to users’ needs.
Users can easily get various designs without too much effort once they can utilize the API efficiently. For design purpose, users are able to get random colors, or dimensions, or materials for each instance, like windows, and panels easily by using API connecting C# language and Revit. Without API, users need to change each instance one by one manually. If there are 200 windows on one side of the building needed to change their colors, it will be very tedious and time-consuming. By API, it can be done in ten seconds by simply use the add-in function. Moreover, Revit with API can change designs, such as the angle of the roof, based on the environmental impacts including sunlight, wind, and other impacts.

My Idea of Utilizing API

Continuing from my first project--Eden Project, I would like to add my own design for sake of energy efficiency. According to the feature of the project that inside of the building is all plants, I want to make some openings by panels to allow ventilation based on the weather.  Openings can be larger in summer while smaller in winter. Those openings can be located at the two bottom panel lines. To achieve this goal, I need to manually select more than 300 panels and change their parameter in Revit. If I want to change the degree of opening, I need to do the same thing over again. But by using API coding my language, I will be able to change them automatically in less than 5 seconds.

Let’s START

In order to change only some part of panels in the mass, I need to edit my panel family.
Step 1: Edit new panel family
(In order to make the shape clearer, I removed the void form component in the panel)
I added several reference lines and replaced the solid form based on the new reference line. At the same time I added one parameter “Panel Angle Height (PAH)” to control the opening. So far “PAH” is “Type” parameter.
Step 2: Load panel to mass
2.1Set “PAH” =0  in panel family and load it to mass since most of the mass anels will not have opening.
 (When the parameter is type, you need to change it by clicking “edit type”. Otherwise, you will be able to change the parameter in the Properties box. You need to select individual panel when editing no matter it’s a type or instance parameter. )
Now “PAH” as a type type parameter, once you change “PAH”, everything changed.(It’s just a experiment. Before you start step2.2, change “PAH” back to “0”)

2.2Come back to panel family, and change the parameter “PAH” from type to instance. Then load it to mass again. Now you can change individual panel by selecting it and change its “PAH”

Step 3. Writing C# language
When writing the C# language, one should understand the logic of the process. Before start writing, I will ask myself the following question:
-         What do I need to change? In order to get this change done, what parameter I should control?
-         What are driving parameters? What’s the relationship between these parameters?
-         How can I get these parameters’ ID? In the project or in the mass family?
My answer was:
-         I want to change the angle of the panels located in two bottom circles and I need to control “PAH” to make the change.
-         I need to set up a driving parameter: Temperature (T) in parameter family
The relationship will be: PAH = T * 0.2
-         I have to know the big mass ID in project level while get the panels instance ID in mass family level. (Only choose the panels I want to change)
After answering these questions, I used the template Dr. Yan provided and changed parameters’ definition to get new objects, and define formula for calculating of parameters’ new value.

Results

Before run the add-in, I first rebuild the C# solution and then load XX.dll to Revit Add-In.
When I load my Add-In, panels in the two bottom circles opened based on the temperature set. The following screenshot shows the change.
If I go to my mass family and changed the temperature parameter and run Add-In again, panels will be changed accordingly as shown in the screenshot below.

If I want to open some other panels, I just need to go mass family and find  the ID of these panels, then add them to the element ID group in C#. The following screenshot is taken after I added four TOP panels’ ID into my C# component part.

Findings

During my second project for BIM, I succeeded in changing the bottom panels’ openings based on temperature.  I tried to decrease the gird number (which determines the layer number of each dome) of individual dome, it still works well. All the desired panels are open. However, I found if I increase the gird number, there will be some panels keep closed. (As shown in the next screenshot) After some thinking, I found out that there will be more panels in a bottom circle due to the increased layer number. The additional panels will not change due to their ID numbers are not in the mass family.

At first, I tried to figure it out by using C#. Unfortunately, I found nothing. After a while, I came up with another idea that I can make a larger grid number which is the maximum grid number using in my project in my mass family and choose ID number form this mass with the largest grid number, and then load to my project. By doing this I only need to decrease the grid number for individual dorm. In this case, all the desired panels’ ID has been included in my C# API already and will change accordingly.

Conclusion

API is a power tool when multiple similar instances need to be change to a certain value or random values. It will save significant time and efforts.
The lesson I have learnt is that I need to understand the advantage and disadvantage of the software itself. For example, some parameters can be easily linked inside of Revit level while some are easier by using API. My little finding is another example for it.
There are still a lot to explore in the Revit world. I believe practice makes perfect.

Comments

Popular posts from this blog

BIM-Project 1-Eden Project Modeling