2/13/2012

Accessing parameters through Revit API




Introduction

Part 1 of this project involved the use of Revit API to overcome some issues faced during the project 1 which could not be overcome otherwise. While for part 2, API code was used to arrive at some creative and interesting results.

Part 1

During the project 1, the mass family that was developed initially comprised of all the building elements. However, when the family was transferred to the project, Revit was unable to create mass floors. Hence the family was edited into two separate families called CORE (having building mass and central core) and SPINE (having outer spine). Both the families had the same underlying skeleton of reference line, reference points and parameters. The problem being that the user now had to enter the parameter values separately for both the families. This part aimed at resolving this issue through API code.
Figure below shows the underlying logic of API code.


Following figures show some snippets of code



Retrieve family instances and their parameters


Get the values of parameters


Update the value of SPINE family parameter

Before running the code 




After running the code


Part 2

The second part of the project 2 aimed at exploring the creative ways in which Revit API can be used. The aim was to change the material of window family in a random fashion while the width of the window is determined by the elevation at which it’s located. Initially it was intended to apply the window family (Curtain panel pattern based) on the surface of original building, but Revit was unable to generate the geometry. Hence the concept was tested on a mass family with flat surfaces. 
Figure below shows the underlying logic of API code.



Following figures show some snippets of code


Get the values of elevation



Retrieve family instances and their parameters



Get the values of parameters



Update the value of family parameter



Before running the code


After running the code


>>>In Progress<<<