BIM Coordinator Program (INT) April 22, 2024

Find the next step in your career as a Graphisoft Certified BIM Coordinator!

About building parametric objects with GDL.

Novice GDL question - which 3D object type to use?

Jim Allen

Apologies if this has been covered elsewhere, I've been looking at a lot of GDL posts and documentation, and I've both learned a lot and been very confused, probably both in equal measure.


I want to create an object which is in effect a 2D and 3D gradient labelling tool. I want to insert it onto a mesh, and then stretch the length and rotate as required, then go to the 3D window and use a hotspot to anchor the non-base end of the symbol to a point on the mesh to give me the z height difference to calculate the slope, and have the gradient displayed in 2d and/or 3D with options for angle, percentage or slope ratio.


The purpose of this object is twofold, the first is simply to label gradients in 3D. Where I work, most of my sites have slopes and gradients. I often have deal with site gradients and cut and fill, so use terrain modelling on most projects. Designing ramps is a ball-ache, and they are expensive and ugly to construct. If I can design them out, so much the better.


Any slope shallower than 1:20 is a 'gradient path' and doesn't need all the complexity of a ramp.


I like to use meshes in 3D and push and pull the nodes to shape the terrain as part of my design approach. Having a tool like this would actually make the design process a lot easier because I could push and pull my mesh, adjust the label and check compliance. 


I started with the Archicad Slope 25 symbol which I have duplicated and edited. This is a screenshot of the modified object:

Screenshot 2023-01-13 at 10.49.53.png


This is broadly how it's scripted:


Screenshot 2023-01-12 at 16.25.24.png

 So far so good. I can take the values for the polyline and hotspots and translate them to 3D, and hopefully that will work except I'm not sure which script to use.


What I in effect want is to be able to define a 'slab' which will rotate in 3d (or 'tilt') when I move the editing hotspot in the z axis, so it looks something like this:


Screenshot 2023-01-13 at 10.27.20.png

Without the circles and labels obviously.


The 3D text will be in a similar position to the 2D text if things work out - but inclined in the plane of the arrow. I want the 2D and 3D appearance to be ostensibly the same.


There is a lot of information on GDL, but not all of it is clear, simple and comprehensive, and it doesn't seem to tell you what the properties of them all are, and what their limitations are, and what they are best suited to.


Should I use a PRISM for this, or can I use an EXTRUDE instead? I just want to translate the 2d xy coordinates to 3D (because it seems easiest and I'm very new at this, and still a bit of a GDL idiot) and have the geometry update itself when I move the 3d hotspot.


Alternatively - is there a better option available that I have missed. Aligning the 3d text will require some head-scratching, but one thing at a time.


Any help and guidance would be greatly appreciated!

Archicad 27 UKI | OS X 12.7.1 Monterey

I would use a tube

So in effect the profile I have drawn to create the tube would be extruded vertically I guess - makes sense, because if I have a 3D hotspot at either end of the profile, once one is at a different Z height, the geometry should resolve itself.


Unfortunately that's the only thing about the TUBE script that makes sense to me!


I've tried EXTRUDE, PRISM, POLY and SLAB - they all work in the sense of creating the 3D shape, but don't allow me to drag the hotspot in the Z plane.


This is my 3D script:



HOTSPOT 0,0,0,unID :	unID=unID+1

HOTSPOT 0,0,0,unID,a,1+128 :unID=unID+1
HOTSPOT a,0,0,unID,a,2 :unID=unID+1
HOTSPOT -1,0,0,unID,a,3 :unID=unID+1

!extrude  6,      1+2+4+16+32+64+128,      
!        0, 		0,     	0, 
!        B/2, 		-B/2, 	1,
!        A-(B/2),	-B/2, 	1, 
!	 A,		0,	1,
!        A-(B/2),	B/2, 	1, 
!	 B/2,		B/2,	-1

!PRISM_  6,      0.005,      
!        0, 		0,     	15, 
!        B/2, 		-B/2, 	15,
!        A-(B/2),	-B/2, 	15, 
!	 A,		0,	15,
!        A-(B/2),	B/2, 	15, 
!	 B/2,		B/2,	15

!poly  6,          
!        0, 		0,
!        B/2, 		-B/2,
!        A-(B/2),	-B/2,
!	 A,		0,
!        A-(B/2),	B/2,
!	 B/2,		B/2

SLAB  6,      0.005,      
        0, 		0,     	0, 
        B/2, 		-B/2, 	0,
        A-(B/2),	-B/2, 	0, 
	A,		0,	0,
        A-(B/2),	B/2, 	0, 
	B/2,		B/2,	0



I do not understand the TUBE syntax at all. That's not at all for novices! It's not documented in the Object Making with GDL or GDL Cookbook guidance. 


I've looked at the RULED option, which is a lot simpler, would that work in the same way?

Archicad 27 UKI | OS X 12.7.1 Monterey
Marc H

Hi Jim,

Way out of my depth here (a GDL newbie myself), but after reading your post I'm wondering: Do you want a label that responds to your mesh edits, or an object that you use to set the mesh edits?  On reflection, I'm thinking the latter, unless I'm missing something in your post.


With that, what I might consider is using the AC Ramp object (straight or curved) scripting to your advantage, since those objects already have 3d shapes, variable rise and run parameters and calcs, and resulting 2d labels.  Maybe the result is a 'simpler gradient object' from the ramp object which has a 3d top-of-gradient and 3d bottom-of-gradient shape (I'm thinking something like a surveyor's cylinder monument or a simple rectangular terminus object) with a variable distance parameter in between.  Perhaps a narrow centerline shape if you want to convey that path.  


You set the desired distance and grade value and plant one end at the start and let your gradient object, based on gradient and distance (like the ramp object), set the other end.  Then you snap your mesh to meet up at the terminal points.


I see you also want the label in 3d, but that is beyond my present horizon, too ! 😑 


The example here is just the Ramp object with transitions and flanges off, thickness set to 1", and an AC26 Elevation Label added on plan. 


Ramp with Trans Off and AC26 Elev Label.png
“The best thing about the future is that it comes one day at a time.” - Abraham Lincoln

AC27 USA on 16” 2019 MBP (2.4GHz i9 8-Core, 32GB DDR4, AMD Radeon Pro 5500M 8G GDDR5, 500GB SSD, T3s, Trackpad use) running Sonoma OS + extended w/ (2) 32" ASUS ProArt PAU32C (4K) Monitors
David Maudlin



You should look at the CROOF_ command, as it is similar to the Roof Tool, it can create a 3D slab with slope. You could use the PRISM command, but will need to use one of the ROT commands before it to create the angle, and calculate the PRISM locations based on the angle. You should be able to use the points you define for the 2D polygon as part of this element. [The Poly2_ command in your example does not make sense to me, as it is calling for 7 nodes, but I only see 6 in the script.] This is a good project to get into GDL: it is relatively simple and serves a need for you, rather than being an abstract exercise.


You should add a Signature to your Profile (click the Profile button near the top of this page) with your ArchiCAD version and operating system (see mine for an example) for more accurate help in this forum.



David Maudlin / Architect
Digital Architecture
AC27 USA • iMac 27" 4.0GHz Quad-core i7 OSX11 | 24 gb ram • MacBook Pro M3 Pro | 36 gb ram OSX14

hi Jim , try next

!---------- THIS IS YOU 2D SCRIPT-------------

!pen outline_pen
!set line_type "solid line"
!fill fill2
poly2_ 7, 1,
0, 0, 13,
B/2, -B/2, 13,
A-B/2, -B/2, 13,
A, 0, 13,
A-B/2, B/2, 13,
B/2, B/2, 13,
0, 0, 1

!----------- ADD THIS IN 3D-------------

PRISM_ 7, 0.01,
B/2, -B/2, 15,
A-B/2, -B/2, 15,
A, 0, 15,
A-B/2, B/2, 15,
B/2, B/2, 15,
0, 0, 15


try it and tell me how it works, then I can help you with the text

Peter Baksa



a question you didn't ask, but could help making your object easier to use: you can merge the 2d rotation - length-editing - height editing workflow to one step with a hotspot which is free to move in space. Read to see how it can be done.

From there your script can calculate the projections of the 3D vector and the various angles between the projections and the axes. I'd transform to the tilted plane, and model flat shapes in 3D using POLY. For the text additional transformations are needed to untilt it.


Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest

Hi Peter, that is undoubtedly the best way to do it (hotspot and calculations for the plane to draw a poly) but it's a programmer's solution and is a lot more complex for someone like me, whose GDL skills are at a low level.


Most of the GDL guides are written from a programming point of view, which is not ideal for non-programmers. It's okay, because a great many people have managed to learn the language, but I think it represents a barrier to novices. There's a lot of it, it's complex, and daunting, which means dedicating quite a lot of time to learning. Fortunately workload is pretty light at the moment, which allows me chance to mess around, but I have spent several days experimenting just to get where I am, which isn't really very far 😀


This phrase calculate the projections of the 3D vector and the various angles between the projections and the axes is precisely the sort of thing that fills me with dread!


It's way more complicated than building extruded geometry in the XY plane that can be inclined by moving a hotspot in 3D, and relies on quite a bit of GDL knowledge, way more than I currently have, and learning how to approach the syntax and mathematics and then scripting something like that is a whole world away from what I normally do. The only mathematics I do is area calculations and percentages, and the occasional simple formula for components.

Archicad 27 UKI | OS X 12.7.1 Monterey

Hi Jorge,


Thanks for the assistance, this is what my script created:


Screenshot 2023-01-16 at 10.53.06.png

This is what yours created:

Screenshot 2023-01-16 at 10.52.30.png

My shape works fine, it's the inability to move the 3D hotspot in the Z axis, and have the geometry update that's the issue. I don't think the PRISM option is the right one.


David Maudlin's CROOF suggestion, looks like it might work in the way I want, it sounds like a better option. I really don't want to have to script all the trigonometry...


Archicad 27 UKI | OS X 12.7.1 Monterey

Thanks David, I did find CROOF, but I hadn't got around to testing it.


The POLY2 command basically ends up back at the start point. Apparently some commands require that, and it enables me to take exactly the same set of coordinates for use in every command.


Laziness I guess!


I've added a signature - thanks!

Archicad 27 UKI | OS X 12.7.1 Monterey
Learn and get certified!