GDL
About building parametric objects with GDL.
SOLVED!

Reading Autotext value into a variable

Eric B
Enthusiast

Good evening

 

Apologies if this has been asked before but I could not find anything relating to this

 

How can you read an autotext value into a variable in GDL

 

I would like to be able to do the following and read the first two characters of the Master Layout Name:

 

strsub("<MASTERLAYOUTNAME>", 0, 2)

 

Many thanks

 

Eric


AC6 till current
PC and Mac
1 ACCEPTED SOLUTION

Accepted Solutions
Solution

The only way I found to get the sheet size in a GDL Object is via the subtype 'drawing title'

With this subtype you'll get the array AC_LayoutRect that has the information you need.

Xandros_0-1688451840722.png

 

ArchiCAD 27 GER / Win10
Intel i9-9900K / 64GB RAM / nVidia GeForce RTX 2080 Ti

View solution in original post

10 REPLIES 10
runxel
Legend

@Eric B wrote:

How can you read an autotext value into a variable in GDL

 

Sorry to inform you: You can't.

Autotext is an abstract layer on top. GDL does not see it.

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»

Thats not the answer I was looking for 😂

 

Is there a way to get sheet information into GDL i.e sheet width or sheet height?

 

I am trying to auto populate the scale in a drawing title with the sheet size ( Scale 1:100 @ A3)

 

Cheers

 


AC6 till current
PC and Mac
Lingwisyer
Guru

Even if there was a request for sheet size, using it to generate a scale would not work as the object would need to be placed on a sheet in order to read it, in which case it would not be able to see the GLOB_SCALE of placed views... or it would see the scale of every placed View. There is a way to do a scale bar within the title object of a View if that will do. I think one of the Drawing Titles in the US library has that option. For us, we sometimes want to show the scale at multiple sheet sizes so in a way not having it linked is good for us. The user can select the scales they want to show at the page sizes they want, and I guess everyone here is used to how slow it was for us to change in aCAD.

 

 

Ling.

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win11 | i9 10850K | 64GB | RX6600 Win10 | R5 2600 | 16GB | GTX1660

Hi Ling

 

Thanks for your reply

 

Sorry I may have not been very clear. I don't want to generate a scale I just want to append the sheet size to end of the scale '@ A3'

We have had a couple of instances where a client has asked for drawings to be published on A3 when they were originally published on A2. Our current drawing title has this as a custom field but when you republish them on a different size sheet you have to go and manually update all of the drawing titles

 

I was hoping now that you can get the Master Layout Name as auto text I could use this as all of our Master Layout Names start with the sheet size

 

Cheers


Eric


AC6 till current
PC and Mac

You probably can get the master layout name, but you can't get the first 2 characters only.

You can read and show autotext values, but you can't manipulate them or use the value in any sort of calculation.

So you will be stuck with the full master layout name.

 

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

Hi Barry

 

Yes I can get the full name with <MASTERLAYOUTNAME>

 

I was hoping I could just add it to a variable and be able to run  it through a series of if statements to figure out the sheet size but the contents of the variable is '<MASTERLAYOUTNAME>' rather than the actual name

 

Cheers


Eric

 

 


AC6 till current
PC and Mac
Solution

The only way I found to get the sheet size in a GDL Object is via the subtype 'drawing title'

With this subtype you'll get the array AC_LayoutRect that has the information you need.

Xandros_0-1688451840722.png

 

ArchiCAD 27 GER / Win10
Intel i9-9900K / 64GB RAM / nVidia GeForce RTX 2080 Ti
Lingwisyer
Guru

A2 at A3, RIP your scales...

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win11 | i9 10850K | 64GB | RX6600 Win10 | R5 2600 | 16GB | GTX1660
Erwin Edel
Rockstar

I am probably missing something obvious, but we ussually have an A1 set at 1:100 and an A3 booklet scaled to 1:200 (50%) for this reason and since the views just update automatically, it's a matter of making the booklet once and just keep publishing it as needed.

Erwin Edel, Project Lead, Leloup Architecten
www.leloup.nl

ArchiCAD 9-26NED FULL
Windows 10 Pro
Adobe Design Premium CS5