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:
If anyone is able to give me some directions, I'd be very thankful! 😊
Solved! Go to Solution.
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.
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.
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! 🙂
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:
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.
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!
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)
Lingwisyer, I suppose I'm almost there! What I managed so far:
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:
I was able to print out the texture name used in that surface, using the "gs_mat_texture", with the following:
And achieving this result:
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.
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.