How to Create Revit-like Adaptive Components in ARCHICAD?
I have been experimenting a lot these days with the GH-AC Live Connection and have been trying to push its limits and find new uses for some of its amazing features.
I was in a discussion with a fellow colleague about how when Revit Adaptive Components was introduced in 2011, it quickly became one of the most sought after workflows to create repeating parametric systems that conform to some user-defined constraints. Adaptive points in Revit are created by modifying reference points. The geometry drawn by snapping to these flexible points results in an adaptive component. Adaptive components can then be used to pattern panel families, adaptive component families, and the conceptual massing environment.
I wanted to explore if we can create something similar to Revit Adaptive Components using the GH-AC Live Connection. This experiment is divided into 2 blog posts with increasing complexity and detail.
You need to have the latest Rhino, Grasshopper, ARCHICAD and the GH-AC Live Connection installed for this to work.
This blog post explores the idea of creating a simple parametric GDL Library Object in ARCHICAD and control the parameters of that Object via Grasshopper using the GH-AC Live Connection. To illustrate it with an example, I have created a mesh of points in Rhino that describes a surface consisting of peaks and troughs. Let’s now try to parametrically define and control the surface using Triangulated panels in ARCHICAD.
Creating a Parametric GDL Object in ARCHICAD
Let’s start by creating a simple Triangular Plane object in GDL. GDL (Geometric Description Language), is a parametric programming language proprietary to Graphisoft. It describes 3D solid objects like doors, windows, furniture, structural elements, stairs, and the 2D symbols representing them on the floor plan. These objects are called library parts.
I understand there is a general perception that GDL scripting is hard and complex, but it is not always so. In this case, we want to create a simple 3 point plane with a material attribute which we will later control from Grasshopper. We literally need only two lines of code; so stay with me.
Rhino file + Grasshopper script + ARCHICAD GDL Object (.Zip folder / 12.0 MB / 5 files)
When you create a new Object (File > Libraries and Object > New Object), the subtype is usually a Placeable ‘Model Element’. We can edit it to make the new Object as a subtype of any other building elements like walls, beams, or furniture. I will go into further detail about this in the next blog post, but for now, let’s leave it as it is.
We will have to write the code for creating a 3 point Plane In the 3D Scripts pane of the editor. Let’s refer to the GDL syntax manual published by Graphisoft for creating a Plane in GDL. The syntax is as below.
PLANE n, x1, y1, z1, ... xn, yn, zn
where PLANE is a polygon on an arbitrary plane with ‘n’ edges (n >= 3). x1, y1, z1, ... xn, yn, zn are the 3D coordinates of the points making up the polygon. It is better if the polygon is planar, though the interpreter doesn’t check this condition.
Since we want to create a 3 point Plane, the syntax should be:
PLANE 3, X0, Y0, Z0, X1, Y1, Z1, X2, Y2, Z2
where X0, Y0, Z0, X1, Y1, Z1, X2 , Y2, Z2 are variables which we will control parametrically from Grasshopper.
Now that we have created the plane, it would be great if we can add Material properties to it. The syntax for that would be:
MATERIAL _mat
where _mat is the variable for surface material.
Click on the ‘Check Script’ button to make sure there are no errors. And that's it. With just these 2 lines of code, we can create any pattern of Triangulated Panel geometry and parametrically control them using Grasshopper.
The 2D Script pane contains a parametric 2D drawing description and allows us to visualize the 3D geometry in 2D. Let’s leave the 2D Scripts pane blank for now. We will get back to this in the next blog post.
In the Parameter script pane, sets of possible values can be defined for the Object’s parameters. Since we created this new object as a subtype of ‘Model Element’, the default parameters for that subtype are inherited and appear in blue. We can either delete the parameters or choose to ignore them by clicking on the red cross button under Display.
Then, we will have to add the coordinate parameters, X, Y & Z for the 3 points as variables. You can click on the ‘New’ button and add the Variable (same as defined in 3D Scripts pane), Type (length, angle, boolean etc.), Name (as you want to see in Grasshopper) and Value (could be 0, since we will anyway control this from Grasshopper). Using this method, we will have to add all the 10 variables defining the 3 points and their surface material.
Although we have created the 10 parameters needed, Grasshopper, by default, cannot access the parameters of ARCHICAD’s Library Parts. We can enable Grasshopper to access the object’s GDL parameters by simply adding one more variable.
To allow that, we have to create a ‘Boolean’ type variable called ‘ParamcontrolByGrasshopper’ and set it to ‘On’. Click on the red cross button under Display to make the variable invisible on the user interface of Grasshopper.
After everything is set up, use File > Save as to save the Library Part under a new name to the Embedded Library.
Controlling GDL Object from Grasshopper
Now that we have created the GDL object, let’s set up the grasshopper script that can define the surface consisting of peaks and troughs in ARCHICAD. The idea is to create a Grasshopper network that simply takes the surface generated in Rhino and creates a mesh of points that act as inputs to the GDL Object.
Once we have the network setup, let’s use the Object Settings node from the ARCHICAD tab in Grasshopper. Right-click on the node to bring up a contextual menu from where we can choose the ARCHICAD Library Part and its parameters to edit. Remember to turn on the GH-AC Live connection (Design > Design Extras > Live Connection) for the menu in Grasshopper to show up.
Every parameter that we check in the menu will appear as an input parameter on the left side of the Object Settings Node. From this point on, we can define and control the GDL Object in Grasshopper.
Final Result in ARCHICAD
Once we set up the Grasshopper script completely and turn On the Live Connection, we can see the geometry being translated to ARCHICAD seamlessly as native BIM Elements. We can look at the X,Y,Z and material parameters of each object from the Object Settings dialog box in ARCHICAD. As we modify the mesh of points in Rhino, the BIM model gets updated automatically to form a surface of Triangulated panels in ARCHICAD.