GDL
About building parametric objects with GDL.
SOLVED!

GDL - Include the name of a surface in the parameters of an object

pedrocollares
Enthusiast

Hi all. I'm new to GDL subjects and I wonder if something I want to do is possible to achieve.

 

I need to create a 2D object that contain texts that come out of a surface parameter of my GDL object. Surface parameters in GDL I assume that mean only a surface index, and I couldn't find a way to "Get" the surface whole name and make a text out of it.

 

Surface names in my project follow this convention: "01 | WALL | BOARD FORMED CONCRETE WALL". I want to create a GDL object that contain such surface parameter and is able to print out substrings of that text, in that case "01" and "BOARD FORMED CONCRETE WALL". It should look something like this:

pedrocollares_0-1631064871366.png

If anyone is able to give me some directions, I'd be very thankful! 😊

Architect / BIM Manager at IDEIA1 - www.ideia1.com.br
Archicad 26 / Windows 10 64
12 REPLIES 12

Since the string parts I'm using follow the same character structure, I'm using STRSUB to separate the blocks of text. I came across a few issues though:

 

I have surfaces of different categories, like "PAR" for walls, "FOR" for ceiling, so on.. and those categories are parts of the surface name. I created an array variable to each of those categories, and stored the names there. (This object is running through all the surfaces in the project)

 

pedrocollares_1-1632152263347.png

 

When I try to print a value of those arrays, it works fine. When I try to create a substring out of it it gives errors.

 

pedrocollares_2-1632152815081.png

 

Seems to me the Variable[X] value can't output a substring. Maybe it isn't a string?

 

------------------

 

Also, I placed a subroutine to sort alphabetically the surface names. But where do I put subroutines? If I place an "END" statement at the master section, it will skip the 2D page. If I place the subroutine at the 2D page, it will give errors in 3D.

 

pedrocollares_3-1632153031416.png

 

 

Thanks a bunch for your help! 🙂

Architect / BIM Manager at IDEIA1 - www.ideia1.com.br
Archicad 26 / Windows 10 64
Solution

REQUEST "Name_of_material" returns empty string in parameter script. If you placed it in the master script, there will be an error with the parameter script run. Use GLOB_SCRIPT_TYPE to avoid the parameter script context.

 

The end of the master script can be avoided by adding a label at the end:

...

goto "masterEnd"

 

"subroutines":

...

return

 

"masterEnd":

 

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

Thank you guys who gave me tips here. I managed to do exactly what I was trying to, and I think it's working just fine. Once my knowledge in GDL grows better I'll attempt to rewrite it with cleaner code.

 

pedrocollares_0-1632353193323.png

 

But it served its purpose flawlessly and ended up looking nice imho 😅

Its an object that has 2 functions: giving a whole list of surfaces used following a prefix criterion, or showing certain surfaces chosen at the object parameters

 

Still would need a bunch of tinkering to be useful to anyone else, just posting to share the outcome. Heheh

Architect / BIM Manager at IDEIA1 - www.ideia1.com.br
Archicad 26 / Windows 10 64