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
2 ACCEPTED SOLUTIONS

Accepted Solutions
Solution
n = REQUEST ("Name_of_material", superficie_1, surface_name)

 

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win10 | R5 2600 | 16GB | GTX1660 

View solution in original post

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

View solution in original post

12 REPLIES 12
Lingwisyer
Guru

You will need to use the Split command to isolate the material number from it's name. In order to do this you will probably want to use the STRSTR command to get the position of your dividers which can then be inserted into Split as %n. You can then insert these new paramters into seperate Text2 commands.

 

 

Ling.

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win10 | R5 2600 | 16GB | GTX1660 

Lingwisyer, thank you for the tips. That does handle the part of splitting the string.

 

Although, I still don't have much of a clue on how to put out a TEXT2 command using the 'name' of a certain surface. I want this GDL object to print out names of surfaces that exist in the project. Having a text parameter would involve manually entering/updating such names.

 

pedrocollares_0-1631106611548.png

 

Seems to me the surface parameter consists only of the surface index. Can I use that name of the surface as a string inside the object?

 

Thanks in advance! 🙂

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

If you are wanting your label to associate to some entity in your model, you will need to use a Request to find out the out the type of entity then from that check for Surface Overrides and if those are off, a Request for the bmat. 

 

There was a post following these lines somewhere around here, but the forum change has made some things difficult to find...

 

See these threads:

https://community.graphisoft.com/t5/Developer-forum/Is-there-a-way-to-request-a-building-material-na...

https://community.graphisoft.com/t5/Document-Visualize-forum/Smart-surface-tagging-Openings-Objects-...

 

 

 

Ling.

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win10 | R5 2600 | 16GB | GTX1660 
pedrocollares
Enthusiast

Thanks again for your reply Lingwisyer! I'll try to explain with more detail what I'm trying to achieve. I'm editing a GDL object that has surface parameters associated to it.

 

pedrocollares_0-1631652298812.png

 

That surface associated to it should have a name that follows this convention:

 

<INDEX OF SURFACE> | <SURFACE CATEGORY> | < DESCRIPTION OF SURFACE>

 

Generic example: "02 | WALL | CONCRETE"

 

I wonder how can I bring the name of a surface parameter of the object itself to a TEXT2, which will be split in parts as you mentioned above. I want that text information to update as I update the surface parameter of that object.

 

Is there a way to do such thing?

 

Thanks in advance!

 

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

Right. I think you will need to feed Request with your Surface 1 parameter to retrieve the surface name. to You can use the commands in my first post against this new result.

 

 

n = REQUEST ("Name_of_material", superficie_1, surface_name)

 

 

 

 

Ling.

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win10 | R5 2600 | 16GB | GTX1660 
pedrocollares
Enthusiast

Lingwisyer, I suppose I'm almost there! What I managed so far:

 

pedrocollares_1-1632105736947.png

 

My object has a surface parameter assigned to it called "Sup_Param"

Then I want to 'Request' the surface name information from that surface to print it to a TEXT2, but I didn't find such a parameter available at the Material_info section:

 

pedrocollares_2-1632105992643.png

 

I was able to print out the texture name used in that surface, using the "gs_mat_texture", with the following:

 

pedrocollares_0-1632105698912.png

 

And achieving this result:

 

pedrocollares_3-1632106138274.png

 

This text is associated with the texture name, and that's already something. But I'd like it to associate to the surface name instead. Anything very basic I'm missing?

 

Thanks a bunch! 🙂

 

P.D.: From what I understood, Surfaces are named as "Material", or "gs-mat" in the request options at the reference guide, and Materials are "Building Materials", so the material/gs-mat is what I'm after, since I want to use surfaces, not building materials.

Architect / BIM Manager at IDEIA1 - www.ideia1.com.br
Archicad 26 / Windows 10 64
Solution
n = REQUEST ("Name_of_material", superficie_1, surface_name)

 

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win10 | R5 2600 | 16GB | GTX1660 

Oh! I didn't realize you were actually giving me request parameter I should use. It worked! Thanks! 🙂

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

Now just to split the result. I have not tried STRSTR with an input that has multiple of the same divider but from the command description I assume you just need to run it twice. Position 1, split, position 2, split.

 

 

Ling.

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win10 | R5 2600 | 16GB | GTX1660