BIM Coordinator Program (INT) April 22, 2024
Find the next step in your career as a Graphisoft Certified BIM Coordinator!
Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Extracting part of a global variable

Wokka
Contributor
Hi guys,
Hopefully a simple request..?
I've created a simple label to extract a walls composite name. The problem is the name is too long to be practical on a floor plan ie:

'WT06 - Reverse Brick Veneer.'

I'd like the label to just note the first 4 letters. "WT06"
I vaguely recall seeing the ability in GDL a long time ago....

Is there a way I can specify just these few letters instead of the whole name?

Cheers
Warwick Lloyd-Martin
3 D E N V I R O N M E N T
http://www.3de.com.au
Windows 11 Pro 64bit
ArchiCad 4.55>27 AUS
Lumion 12.5/2023
D5 Render
4 REPLIES 4
Barry Kelly
Moderator
STRSUB is the command you are after.
For the first 4 characters of your name you want STRSUB(composite name, 1,4)

Barry.
One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Wokka
Contributor
Barry,
Fantastic, thanks for that. I knew it was somewhere.
The problem is, as I've 'hacked' the original ARchiCad object, I don't fully understand all the manipulations required to get the final result.
I placed in the masterscript:


If gs_content_type = `Composite` then
identify = WALL_COMPS_NAME
endif


after adding a new parameter to the parameter list.
Where do I insert your bit of script?
Thanks again...I know time is money...


DON"T PANIC thanks but I got it to work! Cheers again!
Warwick Lloyd-Martin
3 D E N V I R O N M E N T
http://www.3de.com.au
Windows 11 Pro 64bit
ArchiCad 4.55>27 AUS
Lumion 12.5/2023
D5 Render
Barry Kelly
Moderator
In your 2D script there will be a TEXT2 command to add the text for the name.

i.e. TEXT2 0,0, identify

You will wnt to change this to TEXT2 0,0, STRSUB(identify,1,4)

I am assuming you are using the variable "identify" to hold the name of the composite.
But watch out because it looks like when your "gs_content_type" parameter is not `Composite` then you will have a blank "identify" parameter and no text will appear.
I can't say for sure without seeing all of the script.

Barry.
One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Wokka
Contributor
Thanks again Barry,
All working fine now!!
Cheers
Warwick Lloyd-Martin
3 D E N V I R O N M E N T
http://www.3de.com.au
Windows 11 Pro 64bit
ArchiCad 4.55>27 AUS
Lumion 12.5/2023
D5 Render
Learn and get certified!