Learn to manage BIM workflows and create professional Archicad templates with the BIM Manager Program.

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

SORT function would be a helpful development

Seems to me that a SORT function would be a helpful development.

You could use it in the form,

SORT 0,x1,x2,x3,x4,x5,x6
and the list would be placed in a memory buffer in the right order. 0 would be descending and 1 could be ascending, maybe 2 could be forced randomised.

If you already had stuff in memory, you could do:

SORT 1,GET(NSP)

I know the first reaction of GS's team will say that a half decent GDL programmer should be able to write their own routine. But we are architects, not professional programmers!
I have occasionally had to sort numbers, and its been a real pain writing (composing) a sort routine from scratch. Back in the days when computer magazines covered programming there were all sorts of sort routines published, but these dont exist now. You have to rethink the methodology of sorting and write something that works. Bubble sort is the one I can remember from the eighties.
I would add that a half decent programmer might be able to build a Cube from basic GDL (there is a long routine in the old manual using NODE, EDGE, VECT etc,) but thats the whole point - its better to have the BLOCK routine which encapsulates complex code into a single command. Same with SORT.
1 REPLY 1
Karl Ottenstein
Moderator
david wrote:
Seems to me that a SORT function would be a helpful development.

You could use it in the form,

SORT 0,x1,x2,x3,x4,x5,x6
Hi David,

Back from (another) trip... I disagree that adding new commands to GDL is the way to proceed for something like this. As Oleg commented elsewhere, if GDL had a conventional syntax for FUNCTIONs and SUBroutines with named parameters and return values, then any number of conventional functions, such as sort, could be provided in a standard library ... and more could be written by the user community.

Let's continue the pressure to have GDL move forward to the 1960's. 😉

Karl
AC 28 USA and earlier   •   macOS Sequoia 15.3, MacBook Pro M2 Max 12CPU/30GPU cores, 32GB
One of the forum moderators