GDL
About building parametric objects with GDL.

Get the layout name

Bruce
Advisor

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
Barking Dog BIM YouTube
Mindmeister Mindmap
-- since v8.1 --
AC27 5060 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
Patrick M
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.

 


Screen Shot 2022-01-11 at 2.23.51 PM.pngScreen Shot 2022-01-11 at 2.22.20 PM.png
BIM solutions and trouble shooting (self proclaimed) expert. Using Archicad 26 5002 US on Mac OS 11.5.2
Patrick M
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

Patrick M
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
Advisor

"<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
Barking Dog BIM YouTube
Mindmeister Mindmap
-- since v8.1 --
AC27 5060 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 | Graphisoft Insider Panelist | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text | My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»
Bruce
Advisor

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
Barking Dog BIM YouTube
Mindmeister Mindmap
-- since v8.1 --
AC27 5060 INT Full | Windows 11 64 Pro | 12th Gen Intel i7-12700H 2.30 GHz | 64 Gb RAM | NVIDIA GeForce RTX 3060 32 Gb
Bruce
Advisor

GS people: any idea?

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