Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Reading Autotext

derekjackson
Expert
Hi,
I was wondering if it's still the case that GDL objects can't read Autotext values?

We're wanting to make a scale bar object that automatically displays the correct scale when placed on a sheet (based on the Autotext Drawing Scale value).

I read something here about outputting to an XML file but that seems a step too far. Can they not even be read in a text string in some form?

Thanks,

Derek
http://www.lsiarchitects.co.uk
http://derekjackson.artstation.com
AC19 / 21 / 23 / 27
Windows 7 Intel Xeon 18Gb
26 REPLIES 26
DGSketcher
Legend
In the AC20 GDL guide you can hard code an Autotext. See here...

http://gdl.graphisoft.com/gdl-docs/gdl-guide/chapter-12-miscellaneous/autotext-guide/

I see you are on 19 so I don't know if that version has been upgraded to use it.
Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)
derekjackson
Expert
Thanks for the help.

That's halfway there, but we want to then analyse the content of the autotext output, so I guess it can't be done (yet)

Oh well - I'll just have to trust my colleagues to manually enter the scale on the scale bar object
http://www.lsiarchitects.co.uk
http://derekjackson.artstation.com
AC19 / 21 / 23 / 27
Windows 7 Intel Xeon 18Gb
DGSketcher
Legend
Depending on how you use your object have you looked at referencing the GLOB_SCALE value and possibly ac_drawingScale? Although I haven't yet had reason to use the latter.
Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)
derekjackson
Expert
GLOB_SCALE doesn't work - it just returns the 1:1 value of the layout.

I'm struggling to find a reference for how to call ac_drawingScale - I don't suppose you know of one? I suspect it's somewhere in the REQUEST syntax but not getting very far...
http://www.lsiarchitects.co.uk
http://derekjackson.artstation.com
AC19 / 21 / 23 / 27
Windows 7 Intel Xeon 18Gb
DGSketcher
Legend
This might help...

http://gdl.graphisoft.com/tips-and-tricks/creating-custom-label-frame/

You could also interrogate a drawing view title to see how that is put together.

There is a scale bar object in the UK library but I couldn't get it to work logically. Could be worth checking the code to see if it offers any pointers.

Going back to basics I don't see how a scale bar in paper space could shown anything other than 1:1 units, this makes sense as it allows some less digitally savvy operators to print to the right size (recent issue for me). If you have a view at 1:50 and another detail at 1:20 how should the scale bar react?

For me the only logical solution for an adaptive scale bar is to place it in the view where it can adjust to the GLOB_SCALE variable.

One final observation while you are trying to resolve the scale bar you may find you drawings carry a big disclaimer "DO NOT SCALE"...
Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)
David Maudlin
Rockstar
Derek:

This is what I did to add a graphic scale to my Drawing Title. It is not elegant but gets the job done:

ds = AC_DrawingScale
ds1 = `1' = 1'-0"`
ds2 = `6" = 1'-0"`
ds4 = `3" = 1'-0"`
ds8 = `1 1/2"= 1'-0"`
ds12 = `1" = 1'-0"`
ds18 = `3/4" = 1'-0"`
ds24 = `1/2" = 1'-0"`
ds36 = `3/8" = 1'-0"`
ds48 = `1/4" = 1'-0"`
ds72 = `3/16" = 1'-0"`
ds96 = `1/8" = 1'-0"`
ds144 = `3/32" = 1'-0"`
ds192 = `1/16" = 1'-0"`
ds120 = `1" = 10'`
ds240 = `1" = 20'`
ds360 = `1" = 30'`
ds480 = `1" = 40'`
ds600 = `1" = 50'`
ds1200 = `1" =100'`
If AC_DrawingScale = ds1 Then
noma = `1/4"`
nomz = `1/2"`
noend = `1"`
EndIf
If AC_DrawingScale = ds2 Then
noma = `1/2"`
nomz = `1"`
noend = `2"`
EndIf
If AC_DrawingScale = ds4 Then

...

The graphic scale is always an inch long, with the correct units displayed for the scale. Note the number of spaces in each text string, they vary from scale to scale. More complicated scales should be possible. I think I poached this approach from one of the Graphisoft graphic scales, but I don't see a Graphisoft Drawing Title with the graphic scale option anymore.

HTH,

David
David Maudlin / Architect
www.davidmaudlin.com
Digital Architecture
AC27 USA • iMac 27" 4.0GHz Quad-core i7 OSX11 | 24 gb ram • MacBook Pro M3 Pro | 36 gb ram OSX14
derekjackson
Expert
Thanks David,
that looks encouraging, but I'm still getting errors as I try to use AC_DrawingScale. Do I need to declare it as a parameter first? I'm assuming not.

I'm getting an 'Uninitialized variable' issue with it.

Any ideas what I'm missing?
http://www.lsiarchitects.co.uk
http://derekjackson.artstation.com
AC19 / 21 / 23 / 27
Windows 7 Intel Xeon 18Gb
David Maudlin
Rockstar
Derek:

I am not sure what is the cause of your issue. My title library part is of the Sub-Type Drawing Title, and has the parameter AC_DrawingScale as a Text Type parameter (see screen shot below). All the references to AC_DrawingScale are shown in my previous post, there is nothing else done to this parameter. You could also look at a Graphisoft title to see if there is something there (or not there) compared to your code.

David
GDL_Title_Parameters.png
David Maudlin / Architect
www.davidmaudlin.com
Digital Architecture
AC27 USA • iMac 27" 4.0GHz Quad-core i7 OSX11 | 24 gb ram • MacBook Pro M3 Pro | 36 gb ram OSX14
derekjackson
Expert
How odd - loading up the Drawing Title subtype doesn't offer me that parameter, and I can't seem to find it in other Graphisoft objects or other nearby subtypes.

This page suggests it should be there:
gdl.graphisoft.com/gdl-docs/gdl-guide/chapter-12-miscellaneous/fix-named-optional-parameters/paramet...

but the attached is what I see when I start a new object with that subtype - not sure what is going on here!!
http://www.lsiarchitects.co.uk
http://derekjackson.artstation.com
AC19 / 21 / 23 / 27
Windows 7 Intel Xeon 18Gb