GDL
About building parametric objects with GDL.

Hack the Surface Label

RHF55
Contributor

I would like to edit the Surface Label 25 to show the text of a surface before a delimiter. For example:

 

Surface Name is TC:Timber Cladding

Label to shown only TC

 

This is the code I have used to get this working on a wall label i wrote a while ago:

!======split
len = STRLEN (string)
iDotPos = STRSTR (string, sep)!sep is the seperator
code = STRSUB (string, 1, iDotPos - 1)
mat = STRSUB (string, iDotPos+1, len-iDotPos)!material

if display_txt = 'code' and code<>"" then
string=code
endif

if display_txt = 'mat' then
string=mat
endif

 

But I cant figure out where to catch the surface name and split it in this object. I think it might be happening in the macro label_content_macro. Any wizards out there that can figure this out??? @Barry Kelly ?

 

Of course this would not be required if GS would give us an ID field for surfaces the same as building materials.

 

Operating system used: Mac Intel-based 12

11 REPLIES 11

That is interesting.

It is the same format for the command, just STRSTR instead of CONTAINS.

 

I just checked the GDL reference PDF in 25 and it is STRSTR there.

 

I never noticed that in the Helpcentre website before (but I wouldn't have been looking for it specifically).

That website is actually out of date now and is no longer being maintained, just left as a reference I assume.

The Archicad help is now here on the Community but the GDL help is only found as a PDF in the application folder or the GDL Centre website here ... https://gdl.graphisoft.com/ (where it is also STRSTR).

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
RHF55
Contributor

Here is the hacked label if someone needs it. Pretty simple but very useful for us.

If you pimp it further, post back with your changes.

 

Thanks for your wizard help @AllanP & @Barry Kelly 

 

Setup info provided by author

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!