2011年4月26日星期二

ARCH653 Project2_Song

The aim of project2 is to improve the BIM model and parametric model using Revit API to pass parameters. Unlike the manual operation in the project1, this one is expected to edit and control behind the revit screen.
Based on the project1 - the Unity Temple, my topic is window width changing. During the design process, we may met the situation that we know the certain plan areas, sometimes which need mutiple changing, certain lighting levels for different rooms based on the functions or directions, and also we want to keep the elevation uniform; which means, keep the constructions and heights of windows the same, change their widths. 
In this project, for example, place five same windows into five rooms as shown in the figure1.
Figure 1: the original windows
Using the tablechair1 as the template, modify the codes.
Start from the region 2, I'll get objects. I choose ID of each window and write the lines five times by changing the ID numbers. Then, I need create the five rooms element IDs. Fot the other regions and every operations, I type them five times. The formula used here is window width = room area * 0.3 (lighting coefficient, assumption) / 6 (height of the window).


Figure 2 & 3: code

Here has two problems. First, there is too much repetition work. I can use "loop" to solve it. Second, when the room is too depth, more lighting needed, then the width of window may exceed the width of the room which make an error. So the width of a window should be changed in a range, limited by the maximum of the room width. The formula is to make it choose the smaller one between the caculate result and the width of room substract the wall width.

Figure 4: loop
After this, I hope it could be user-friendly, the user can input the value directly. If so, there is no need to keep the lighting coefficients all the same. This part should be move from the loop. Here noticed that windows and rooms are paired, the data in defining sets must put in order to promise the correct chosen. Add a form before the loop part, and the interface looks like the following.
Figure 5: interface
Now let's test the results. Try to select different coefficent of the windows and change the area of rooms by moving the walls. Running API process, we'll get different results.
Figure 6 & 7: result

没有评论:

发表评论