GDL
About building parametric objects with GDL.

Get the layout name

Bruce
Expert

How do I get the layout name?  I can't find a request command, or a global variable, or an AC_ variable.

 

I know how to do a TEXT2 0, 0, "<LAYOUTNAME>", but I can't extract this to run a STRSTR command.

 

_layoutName = "<LAYOUTNAME>" doesn't work.

Bruce Walker
www.brucepwalker.com
Barking Dog BIM YouTube
Mindmeister Mindmap
-- since v8.1 --
AC26 5002 INT Full | Windows 11 64 Pro | 12th Gen Intel i7-12700H 2.30 GHz | 64 Gb RAM | NVIDIA GeForce RTX 3060 32 Gb
11 REPLIES 11
4dProof
Advisor

hmmm... saving autotext using <LAYOUTNAME> results in a 2d script using "<LAYOUTNAME>"; and the resulting object definitely pulls the layout name from the layout that object is placed on...

screen shot of script and placed object attached...

what are you saving the script as? haven't tried drawing title and/or label, but it seems to work on my end.

 

BIM solutions and trouble shooting (self proclaimed) expert. Using Archicad 26 5002 US on Mac OS 11.5.2
4dProof
Advisor

also, are you placing the scripted elmeent on a layout or in a view? because you aren't going to be able to reference a layout from a view AFAIK

 

BIM solutions and trouble shooting (self proclaimed) expert. Using Archicad 26 5002 US on Mac OS 11.5.2

AC_drawingname

Edit, my bad, just missed the ac_ part at the end.

Sorry that's the drawing view,

Try AC_layoutname

NVM that doesn't work, maybe drawing name is what you want, but doubtful

4dProof
Advisor

"<LAYOUTNAME>" actually works; I think it may just be a misunderstanding of globals and where they can pull from... or over complicating; not sure what the end goal is for parameter = <GLOBAL>

 

BIM solutions and trouble shooting (self proclaimed) expert. Using Archicad 26 5002 US on Mac OS 11.5.2
Bruce
Expert

"<LAYOUTNAME>" will work if used directly in a TEXT2 (or PARAGRAPH etc) command.

 

I want to take the the layout name, split it at a user-defined delimiter in order to force a carriage return and allow for separate font settings.  This would be placed in the master's title block.

 

E.g.  The layout name "CONCRETE PROFILE PLANS - GROUND FLOOR" would become:

CONCRETE PROFILE PLANS

GROUND FLOOR

 

In order to do this, I need to run a STRSTR command on the layout name.

Bruce Walker
www.brucepwalker.com
Barking Dog BIM YouTube
Mindmeister Mindmap
-- since v8.1 --
AC26 5002 INT Full | Windows 11 64 Pro | 12th Gen Intel i7-12700H 2.30 GHz | 64 Gb RAM | NVIDIA GeForce RTX 3060 32 Gb
runxel
Legend

The magic words are "HomeDB_info".

Request that 😉

Lucas Becker | AC 27 on Mac | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text |
«Furthermore, I consider that Carth... yearly releases must be destroyed»
Bruce
Expert

Thanks runxel - that's what I was (mostly) looking for!

 

This will indeed return the layout name, and will allow me to do my STRSTR splitting.  Unfortunately, it has to be placed on every layout - it won't work if placed in the master (it will always return the master layout's name).

 

 

Bruce Walker
www.brucepwalker.com
Barking Dog BIM YouTube
Mindmeister Mindmap
-- since v8.1 --
AC26 5002 INT Full | Windows 11 64 Pro | 12th Gen Intel i7-12700H 2.30 GHz | 64 Gb RAM | NVIDIA GeForce RTX 3060 32 Gb
Bruce
Expert

GS people: any idea?

Bruce Walker
www.brucepwalker.com
Barking Dog BIM YouTube
Mindmeister Mindmap
-- since v8.1 --
AC26 5002 INT Full | Windows 11 64 Pro | 12th Gen Intel i7-12700H 2.30 GHz | 64 Gb RAM | NVIDIA GeForce RTX 3060 32 Gb