We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

GDL
About building parametric objects with GDL.

Slab-like GDL or Param-O object for city planning?

Kaj_AL
Enthusiast
Hi!

I'm working on a template for city planning and am currently looking for ways to easily mimic buildings in an early stage. Right now I'm using composite slabs with every story a different material, the materials being whatever functions the building has (residence, office, etc.). This doesn't feel optimal as the number of composites quickly become an unmanageable amount, and they're not quite as "smart" as I would like them to be.

So, my question is, is there anyway to build an object that behaves in a similar manner to a slab when it comes to modeling (new nodes with a click, easy to manipulate), or does any one have any other great ideas on how to do this?

Kind regards
Kaj
Archicad 24-27 SWE
Dell Precision 5560, Windows 11 Pro
11th Gen Intel(R) Core(TM) i9-11950H @ 2.60GHz 2.61 GHz
21 REPLIES 21

In case you are looking for some more information, here is a presentation from Enzyme https://geospatialworldforum.org/speaker/presentions2019/Connecting-GIS-BIM-Workflow-Case-Studies-Eu...

 

If you browse to slide 19 or so onwards you get a good introduction to how they use GIS data and grashopper to create 3D site models.

Erwin Edel, Project Lead, Leloup Architecten
www.leloup.nl

ArchiCAD 9-26NED FULL
Windows 10 Pro
Adobe Design Premium CS5

With this approach the area has to be calculated by the script from the polygon coordinates. There is no existing GDL solution, the shoelace formula can be used if there are no curved edges.

 

Another approach could be making a label (if you don't need IES data or 3D geometry). Labels have access to slab data: http://gdl.graphisoft.com/reference-guide/column-beam-and-slab-parameters.

 

Properties can also be created using Property expressions without GDL.

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

Hi Peter! Thank you for your response.

 

I've set up the shoelace formula and it works fine. It feels as though it would be possible to calculate even with curved edges. The slab accessory seems to convert the arcs of the slab into a prism made up of straight polylines. I haven't really figured out where in the process this happens though.

 

If I look at the saved parameters, an accessory created from a rectangle slab has 15 parameters (x, y & status and the first point again with -1 as status). If I make one of the slab edges into an arc, the number of parameters reach around 150-300 instead (231 in my added screenshot). So, my thinking is that I could use those coordinates for the shoelace formula in some way to get a decently accurate result, would you say that's correct?

 

I haven't been able to "find" those coordinates in the Properties Script, only in the 3D. Is it possible to save them in the 3D script and let the properties script read them?

 

I also have not been able to control the appearance of the accessory when using an arc, neither RADIUS, TOLER nor RESOL seems to affect it. Do you know if this can be done?

 

Kind regards

Kaj


Skärmbild 2021-10-25 115141.png
Archicad 24-27 SWE
Dell Precision 5560, Windows 11 Pro
11th Gen Intel(R) Core(TM) i9-11950H @ 2.60GHz 2.61 GHz

I looked into it and the add-on gives only straight edges to the slab object. It can't be controlled.

The polygon is a parameter, it should be available in the properties script. There is an example in the "Footing 1" object.

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

Thank you Peter!

I looked into the Footing object and could figure out what to use in my object. It's not the most elegant, but it does the job.

 

The next step would be to figure out

1. How to do setbacks within the same object.

2. Connect a label that can show custom properties

 

Is that anything you could point me towards?

 

Kind regards

Kaj

Archicad 24-27 SWE
Dell Precision 5560, Windows 11 Pro
11th Gen Intel(R) Core(TM) i9-11950H @ 2.60GHz 2.61 GHz

Sorry, labels can't show properties from the properties script, those are only available for Lists (not Interactive Schedules). But you can access parameters from a label (use REQUEST "assoclp_parvalue") and do the calculations in the label.

Setbacks like solid operations? That sounds difficult, you'd have to intrepret the shape somehow to know what to do.

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

Thank you Peter!

Labels: Okay, I've started looking into the "assoclp_parvalue", but I'm a bit lost. Sorry if my questions are a bit basic, but so am I.

An example: In my object, I have a parameter called num_stories which is an integer dictating the number of stories. How would I write the REQUEST to use this parameter in the label?

 

Setbacks: Yes, either that, or perhaps a separate PRISM with editable hotspots (but preferably something a bit simpler).

Is it possible to somehow ask for another slab or polyline? Say that I want to have a 2 meter setback on my top story. Can I within my object create a button which, when clicked, prompts the user to select an additional slab/polyline, and from this shape subtract the 2 meter setback?

 

Kind regards

Kaj

Archicad 24-27 SWE
Dell Precision 5560, Windows 11 Pro
11th Gen Intel(R) Core(TM) i9-11950H @ 2.60GHz 2.61 GHz

 

num_stories = 0 ! this will receive the value if found
n = REQUEST ("ASSOCLP_PARVALUE", "num_stories", _unused, type, flags, dim1, dim2, num_stories)

 

type, flags, dim1, dim2 are returned from the labeled object, you can double-check them to see whether it's the same parameter that you expect.

 

There is no polygon input method in GDL. You could draw a set of editable hotspots on the polygon to define a second polygon that can be edited vertex by vertex, and you might need some button on the UI to reset it to the current contour of the object.

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

Thanks! I got it to work with the more simple parameters!

 

However, I can't seem to get it to work with the array of coordinates that is my starting polygon. How would I request that array?

 

Another question that popped up; can I in the user interface have a text box for typing in something that goes straight to an array parameter? So, array[1] has it's own box, as does array[2] and so on.

 

Kind regards

Kaj

Archicad 24-27 SWE
Dell Precision 5560, Windows 11 Pro
11th Gen Intel(R) Core(TM) i9-11950H @ 2.60GHz 2.61 GHz

The request always returns a one-dimensional array:

p_values:  for ASSOCLP_PARVALUE returns the parameter value or array of values. The array elements are returned successively, row by row as a one dimensional array, independently of the dimensions of the variable specified to store it. If the variable is not a dynamic array, there are as many elements stored as there is room for (for a simple variable only one, the first element). If values is a two dimensional dynamic array, all elements are stored in the first row.

You need to convert the one-dimensional array to two-dimensional (or use it as such, calculating indices).

 

 

Most UI_...{2} commands can show individual array elements. The reference guide always states where they can be used.

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