Monday, December 7, 2009

Connecting the Pergola to User Defined Parameters

I used the Revit sample called 'User defined Parameter Read and Write' created by Prof.Wei Yan. I started by making changes in the 'UserDefinedParameterReadWrite.csproj' which is a Visual C# coding file. In the command.cs tab, a new list was selected for Pergolas and created as a new element by using the refractor(rename) method. After the 2 types of filters were setup, the Built in category was defined as Generic model as that is the family type for the Pergola. The pergola was also refactored as a new Family Instance.

Two new parameters were defined for length and breadth and formulas were assigned to them with respect to the Room area. Also 2 parameters, len and Breadth was set as 'get parameter' to retrieve them from the pergola's parameters in Revit.

The code could now be debugged. The Revit software opened to a project where i had created a single room with a Pergola in it.
I next increased the area of the room by draging one side of the wall further away. Next i selected the User defined Parameter Read Write option from the External tools drop down menu in the Add In's ribbon tool. This caused the pergola to change in size with respect to the formula used in the code.


Same procedure was followed while increasing the area of the room from an adjacent side. This also showed a difference in the Pergola's parameters with respect to changes in the room area.

Sunday, December 6, 2009

Creating a Pergola in Revit and incorporating Parametric modeling in it

I created a Pergola' (A horizontal trellis or framework, supported on posts that carries climbing plants and may form a covered walk) using the component tool in Revit. A simple example was created in order to use parametric modeling on the Pergola to see how the parameters of various inner families(individual elements of the pergola) can be associated to parameters of the Main Pergola family to enable them to change with respect to each other.

Three individual elements were created using the 'Generic Model' Family option in 3D format in the x,y and z axis directions. The same method used to create the sunshade in Project 1 was used to create the components here. The Length, Breadth and Height were added as parameters and fixed for the components. They were the following.
1. Vertical Component of the matrix
2. Horizontal component of the matrix
3. Stand(Legs) for the matrix.

Pictures are shown below in the same order as mentioned above.


These elements were then incorporated into a Generic Line based Family one by one. First teh Vertical component was added and it was arrayed. The 1st and last elements were locked into place to the top horizontal reference plane and to their respective left and right vertical reference planes. Then 2 more parameters were added for 'Number of Vertical Elements' and 'Vertical element Spacing'. A formula was added so that the Number of Vertical elements = Length of the Vertical Array/ Vertical Element Spacing. This system now worked well as when the length was changed, the other parameters changed respectively.

Next the Horizontal Element was introduced into the Pergola Family. The vertical line where the horizontal elements would be arayed was added as a parameter called 'Breadth'. In the properties of the horizontal element, its length was associated with the length of the vertical array. This ensured that when the length of the array was increased, the length of the horizontal element would increase accordingly. Similiarly in the properties of the Vertical element, its length was associated with the length of the horizontal array (ie Breadth). After the horizontal element was arrayed, the 1st and last elements were again locked to the left vertical reference plane and to the top horizontal reference plane. Again 2 new parameters were created and connected by the formula: Number of Horizontal Elements= Breadth/ Horizontal Element Spacing. Now the matrix worked both ways.

Finally the Stand for the Mtrix was introduced into the main Pergola family. Four copies were made and and locked to the 4 ends of the matrix. The heigth of the whole pergola could be controlled by changing the height of the stand element.


The final resulting 'Pergola' Family could be changed according to the user's wishes with respect to the length, breadth and height of the matrix as well as the number of Horizontal and Vertical elements as well as their spacing. The various length, breadth and height parameters of the individual elements of the pergola could be further be changed either by using the new parameters added for system height or else by opening the individual families and editing them.
























Wednesday, November 11, 2009

Creating new tables in the project which are accessible in the Access Database


I decided to create a table for 'Entourage'. This includes human beings, vehicles and other such objects in the Revit Library. So, this was started by once again opening the RDBLink.cs proj in Visual C#. The project was studied in detail by using an Instance of Door to see how the table was created for it.
The first step to creating a new table was to add Entourage as a new Instance in the RDBLinkData.resx code tab. Next the new table name was added as data in another RDBLinkData.resx code tab where the various new tables are added by their name values.


Next the RDBMetaDataInitialisation.cs code tab was opened and (using the Door Instance as example) new columns for ID, Design Options, Model Comments and Level were added. The ID column was specified as the Primary Key and the Design Option and Level were designated as Foreign Keys.



The RDBLinkDataDesigner.cs would then automatically generate the required codes for it when the project is compiled using Build. Then the project is exported into the ODBC Database once again using RDBLink in Revit Architecture as done earlier.
Finally, the MS Access database is opened to check if the Entourage table has been created. Also the Room Associations table can be used to compare the IDs with respect to the doors, windows and entourage table.



Project 2- BIM API and DataBase




1. Creating new rows in Tables exported from a Revit Project to an MS Access Database

This was done by first opening the RDBLink.scproj in VisualC# Express Edition from the RDBLink folder in the Samples folder of Revit SDK 2010. Next the term 'RoomAssociation' was searched to find out the places where code was written for the project.

In the NonCreatableElemenrList.cs tab, the public class for RoomAssociations was found. The BuilInCategory was studied to see what different elements were presently included in it.
Then the same code was copied and posted thrice to add in .OST_Doors, .OST_Windows & .OST_Entourage as shown in the picture below. Then the project was compiled by pressing Build.
Next Project 1 was opened in Revit Architecture and then it was exported into the ODBC Database by using the RDB Link in the Data Exchange tab in RvtSamples under AddIns. Then the Access Database was opened and found to have the additions of doors, windows and entourage in the RoomAssociations table




Friday, October 16, 2009

My first Revit project





Well, i've finally started using Revit A rchitecture after all the hype BIM has created in the construction industry. I have to say that it is pretty similiar to Archi CAD, which i've worked on before. However Revit, has many more features to boast about, many of which i've just started exloring.

My first project on Revit is my residence in Kerala, India. It is an approx 2000 sq.ft villa. It is made with masonry walls and sloped roofs. It has a small garden with appropriate setbacks on all 4 sides and 2 balconies, one facing the front side and the other facing the rear side.

I first went ahead and imported my Auto CAD drafted plans into Revit in the respective levels of plinth level, first floor, second floor and roof level. Then i drew property lines around the residence and extruded it to form the toposurface. Once i had finished making the building pad, i started making walls and floors. Soon i made a sloping roof over the ceiling slab of the second floor.

I added the appropriate doors, windows and furniture to the plans. Once i had applied the appropriate materials to the individual components, the building was ready.

Next i went ahead with parametric modelling. I decided to create a sunshade for all the windows which would change in length with respect to the window's width. For this, i had to first create a family with the sunshade. So i opened a Generic model family and designed the sunshade using reference planes in the x,y and z axis and then extruding a solid rectangle to form the sunshade.

Then i went on to load this sunshade(family) into the casement with trim window (family) that i had opened from the existing revit files. Once i had aligned the sunshade above the window in various views to the exact point i wanted, i created 3 new parameters namely, sunshade length, breadth and depth in the parameter's page that opens if you press the types tab under the manage tab. Then i selected the sunshade and went to element properties>type properties where i linked the sunshade length with window width using the associate family parameters page.

This fixed the sunshade length with respect to the window width. I had to create 2 more parameters, distance from the left side of trim to sunshade and distance of window from sunshade level before i could finally complete the parameter requirements.

When i finally loaded this casement window with trim and sunshade into my project, it worked perfectly by having the sunshade length and window width changing with respect to one another.

Finally i took one exterior rendered view and 2 interior views to give a realsitic idea of how the project would look after completion.