01. About GDL

GDL is the abbreviation of Geometric Description Language, a functional programming language based on BASIC.

It was created to encourage architects to use this language to build their own geometric objects in ARCHICAD, extending the possibilities of design and presentation.

The needs of your design, your background in programming and your knowledge of descriptive geometry will all probably influence where you start in GDL.

Basic GDL is easy to understand: an architect with the affinity for programming is able to start creating simple objects with only a handful of commands. The more familiar you become with the language, the more complex objects you can add to your growing collection.
These objects can serve multiple purpose:

  • fulfilling custom requests
  • creating a standard object collection for office use
  • creating manufacturer object collection, based on specifications
  • customizing, enhancing objects shipped with ARCHICAD

An object (furniture, door, window, drawing element, etc.) created in GDL is called a library part. The name of the collection of such items is a library.
The concept of a library part includes:

  • floor plan representation
  • 3D representation
  • listing and labeling options
  • user interface
  • parametric values

As you can see, an object created in GDL is able (and should) handle many ARCHICAD contexts.

But how does it work?
Creating a GDL object is based on 3 main principles:

  1. move the local coordinate system using and managing the transformation stack
  2. place 2D or 3D primitives (or bodies) into the coordinate system
  3. set the representation attributes of the used primitives

Most objects of the real world surrounding us can be modeled in GDL space following this simple logic.

2D and 3D primitives
The variety of the available basic items demand and define a certain way of thinking when it comes to solving a geometric problem in GDL. First, get to know what you can work with, get familiar with the commands and options for 2D and 3D representation before trying to come up with a suitable solution.
The basic 2D drawing symbols are:

  • line
  • arc/circle
  • rectangle
  • polygon

To achieve a certain pattern, you can combine these, even layer and overlap them, if necessary (but it’s not really an elegant solution).
See the “Basic 2D Elements page” for details.

Basic 3D shapes:

  • block
  • sphere
  • cylinder
  • prism

By simply placing and combining them, or using solid element operations can lead to a nice model.
See the “Basic 3D Elements” page for details.

Transformations
The primitives listed above do not have any information about their position in space (or plane for 2D). This makes them easy to define, regarding only their own coordinate system. The global positioning and orientation is handled by different items: coordinate transformation commands.
Every object defines its own global coordinate system. All used transformations are calculated within this global object system, derived from the global origin point, and move a local coordinate system, incrementally changing its actual position and orientation. It is a stack function: each transformation you put in the stack will stay in effect, until deleted.
There are 4 types of transformation:

  • move along vector (ADD)
  • rotate around axis (ROT)
  • mirroring/scaling (MUL used with negative values or for distortion)
  • deleting transformation (DEL)

A transformation command takes effect on all subsequently placed primitives. The DEL command is used to delete a transformation from the top of the stack.
See the “Coordinates and Transformations” page for details.

Some historical facts about the language:

  • 1982: GRAPHISOFT and ARCHICAD is born
  • 1983: more 3D modeling options are needed, the first GDL commands are created (ARME, ARMC)
  • 1987: general content should be shipped with the program, so the first library was created
  • 1992: 2D script is introduced, connection with other modeling programs through GDL is made available
  • 1993: environment dependent object creation is implemented
  • 1994: the library content for ARCHICAD became more important (additional value)
  • 1995: lots of 3rd party libraries are starting to become available
  • 1996: User Interface script and Parameter script is introduced
  • 1997: Property script and listing options are introduced
  • 2001: intelligent, associative hotspot editing is available
  • 2002: introducing XML conversion
  • 2003: Basic Library is born: fulfilling the need for general recommendations of GRAPHISOFT standard GDL, a collection of documented base macros, objects and tools were assembled

The language itself is constantly being enhanced, but in a way to keep the compatibility intact as much as possible.
This is quite a challenge for the language developer:

  • the environment provided by ARHICAD is changing according to new feature-introductions
  • traditional commands may conflict with the more advanced programming language items
  • compatibility forces us to keep the old, outdated command as well as the new, enhanced commands

The above creates a new challenge for the GDL programmer as well: you have to choose the correct version (of parametric level) of a command to completely suit your needs.

Since the language have been evolving for so long, and is still in active daily use, sometimes we are forced to make decisions leading to incompatible changes.
To see a list of these necessary, but not fully compatible changes, refer the Compatibility Guide for AC19, and the New Features Guide for every program version.