Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Help with GDL

Anonymous
Not applicable
I am trying to take some rudimentary steps into the world of GDL and was hoping for some advice. I am working on a rafter tail object that is really quite simple, but I would like it to be fairly flexible. I started the object by building it in Archicad with the slab tool and saving that as a 3d object. My problem is with the "sculpted end" of the rafter tail in that I would like the user to be able to change the dimensions of the rafter tail and have the sculpted end change proportionally. I can figure out how to do this with all parts of the code except that which defines the curve. The curve seems to be defined with a series of points versus a center point and radius. It seems like this should be relatively simple, but the solution has eluded me. I will paste the code below and high light the area that seems to be defining the curve with a series of points. I am also attaching an image that will help illustrate what I am trying to do. Thanks in advance for any advice.

cPRISM_ mat, mat, mat,
20, 0'-5.5000",
0'-0.0000", 0'-0.0000", 15,
0'-0.0197", 0'-0.0000", 13,
0'-9.0000", 0'-0.0000", 79,
A, 0'-0.0000", 15,
A-B/tan(90-ang), B, 15,
0'-9.0000", B, 79,
0'-4.2500", B, 15,
0'-4.2500", 0'-4.2500", 15,
0'-3.9875", 0'-4.2500", 79,
0'-3.4706", 0'-4.1588", 79,
0'-2.9773", 0'-3.9793", 79,
0'-2.5227", 0'-3.7168", 79,
0'-2.1206", 0'-3.3794", 79,
0'-1.7832", 0'-2.9773", 79,
0'-1.5207", 0'-2.5227", 79,
0'-1.3412", 0'-2.0294", 79,
0'-1.2500", 0'-1.5125", 79,

0'-1.2500", 0'-1.2500", 15,
0'-0.0000", 0'-1.2500", 15,
0'-0.0000", 0'-0.0000", -1

rafter tail.jpg
4 REPLIES 4
Anonymous
Not applicable
Mike,
Since three dimensional elements are always auto-scripted as
polygonal shapes, you should try drawing the shape using
lines and arcs then save as GDL object or drag and drop
the drawing into a 2D script.

AC will auto-script 2D elements using "additional status codes" (see manual).
These status codes make arcs instead of segmented approximations
of arcs.

Use the 2D code as the bases for the three dimensional CPRISM command
by substituting the coordinates from the 2D code in the CPRISM command
and correcting the code appropriately for the CPRISM.

HTH,
Peter Devlin
Anonymous
Not applicable
Mike wrote:
I can figure out how to do this with all parts of the code except that which defines the curve. The curve seems to be defined with a series of points versus a center point and radius. It seems like this should be relatively simple, but the solution has eluded me...
Mike,
Here's a fully developed solution you might use. I choose to use cutplanes for objects like this...it makes scripting the Prism a little more staighforward. It's not the only way to do it but I find it to be the easiest way to make something like this fully parametric. It also uses the special status codes Peter mentioned.

2dScript:
project2 2,270,1

3Dscript:
aa=a/cos(ang)

!!!ESTABLISHES THE CUTPLANE!!!
rotz 90 !!!ROTATES THE CUTPLANE
cutplane -90 !!!SETS THE CUTPLANE
del 1 !!!DELETES THE CUTPLANE ROTATION

!!!ROTATES THE PRISM!!!
addy b/2 !!!SETS PRISM THICKNESS TO CENTERLINE
rotx 90
rotz -ang


cPRISM_ mat, mat, mat,
10, b,
0,0, 15,
0,-rd,15,
aa-cr-offs,-rd,15,
aa-cr-offs,-rd+((rd-cr)/2),15,
aa-cr-offs,-rd+cr+((rd-cr)/2),900, !!!SETS THE CENTERPOINT
aa-offs,-rd+cr+((rd-cr)/2),3000, !!!SETS THE FINAL POINT ON RADIUS
aa-offs,-rd+cr+((rd-cr)/2),15,
aa,-rd+cr+((rd-cr)/2),15,
aa,0,15,
0,0,1

cutend !!!CUTS W/ THE CUTPLANE


See the attached image for more info about the parameters

Hope it helps,
Dan K
Anonymous
Not applicable
Mike,
Here's a fully developed solution you might use. I choose to use cutplanes for objects like this...it makes scripting the Prism a little more staighforward. It's not the only way to do it but I find it to be the easiest way to make something like this fully parametric. It also uses the special status codes Peter mentioned.
Thank you for all the effort you put in. This small part has been a good exercise to force me to explore the mysteries of GDL
Anonymous
Not applicable
Mike wrote:
Thank you for all the effort you put in. This small part has been a good exercise to force me to explore the mysteries of GDL
Mike,
you're very welcome...I'm happy to do it - GDL was a little painful for me at first and I appreciated all the advice I could get.

If you successful with the script example thus far its a pretty easy exercise to make the part stretchable to repeat the rafters. So many possibilities in GDL !- welcome to the real power of ArchiCAD!!!

Dan K