Wishes
Post your wishes about Graphisoft products: Archicad, BIMx, BIMcloud, and DDScad.

Global Variable (or REQUEST) needed for scale

vfrontiers
Enthusiast
Please consider adding the following global variable...
a. OUTPUT SCALE as a number (1/4"-1'-0" would return 48, etc)
I am in need of using the output scale to create a graphic scale
currently this variable only returns a STRING "1/4:=1'-0"

This number is already available to the system as evidenced in the scale dialog itself.
Duane

Visual Frontiers

AC25 :|: AC26 :|: AC27
:|: Enscape3.4:|:TwinMotion

DellXPS 4.7ghz i7:|: 8gb GPU 1070ti / Alienware M18 Laptop
11 REPLIES 11
Karl Ottenstein
Moderator
Hi Duane! Just to clarify... when you say 'this variable' returning the text string (for Imperial users - it would be the number for non-imperial) - do you mean GLOB_SCALE (previously known as A_)?

I agree that a numeric global would be useful. They seem to have introduced 1,000 new globals for stairs and railings, so adding what you're asking for seems like it would be easy for them. 🙂

BTW - did you look at the existing drawing labels that display a scale to see how they do it?
One of the forum moderators
AC 27 USA and earlier   •   macOS Ventura 13.6.6, MacBook Pro M2 Max 12CPU/30GPU cores, 32GB
David Maudlin
Virtuoso
Karl wrote:
BTW - did you look at the existing drawing labels that display a scale to see how they do it?
In the macro Graphic_Sc_NCS_drawTit they look for a match to the scale name, then GoSub a routine to set the scale numbers, for both imperial and metric units. The code is very lengthy (1364 lines, but some are commented out).

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
Daniel Kovacs
Graphisoft Alumni
Graphisoft Alumni
Hello vfrontiers,

Sorry, but it is not quite clear to me what it is you are asking for. As the guys before me mentioned, GLOB_SCALE does just that - it takes the current scale, and returns the scale factor as a number, so that you can make calculations/comparisons with it.

1:100 ------> GLOB_SCALE = 100
1/4"-1'-0" -> GLOB_SCALE = 48

Is that not what you are looking for?
Daniel Alexander Kovacs

Professional Services Consultant

GRAPHISOFT



For Troubleshooting and useful Tips & Tricks visit
vfrontiers
Enthusiast
That is not my experience...

GLOB_SCALE will return 1/4"=1'-0" (not 48)

Unless this changed in AC22???

d.
Duane

Visual Frontiers

AC25 :|: AC26 :|: AC27
:|: Enscape3.4:|:TwinMotion

DellXPS 4.7ghz i7:|: 8gb GPU 1070ti / Alienware M18 Laptop
Daniel Kovacs
Graphisoft Alumni
Graphisoft Alumni
Hi,

Just to make sure, I have tried this in ARCHICAD 22 USA, on macOS 10.14. I attached a picture of my result.

If you have an object that works differently, please send it to me, so that I can see if this is a bug.

Kind Regards,
Daniel Alexander Kovacs

Professional Services Consultant

GRAPHISOFT



For Troubleshooting and useful Tips & Tricks visit
vfrontiers
Enthusiast
Right.... I mis typed... I am looking for the AC_DrawingScale to produce an INTEGER (like GLOB_SCALE)...

I am needing this to calculate the layout of a GRAPHIC SCALE element in my own TITLE TYPE.

Any Ideas?
Duane

Visual Frontiers

AC25 :|: AC26 :|: AC27
:|: Enscape3.4:|:TwinMotion

DellXPS 4.7ghz i7:|: 8gb GPU 1070ti / Alienware M18 Laptop
Lingwisyer
Guru
I believe AC_DrawingScale returns "1:x", or what ever the imperial equivalent is. So if you are wanting to break AC_DrawingScale into it's two parts, you will need something like this:

string = Bar_Scale1
len = STRLEN (string)
iDotPos = STRSTR (string, ":")
v1 = STRSUB (string, iDotPos + 1, 6)
v2 = SPLIT (v1, "%n", vl)						!v2 = dummy    return = vl

I would assume that since you are working in Imperial, you will need to divide this by your left figure?



Ling.

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win10 | R5 2600 | 16GB | GTX1660 
Daniel Kovacs
Graphisoft Alumni
Graphisoft Alumni
Hello,

OK, that is something else indeed. That is actually a string parameter (the GDL guide calls it a fixed name optional parameter). I forwarded your request to the gdl team, we will see what they think of it.

I am not sure what you need it for but my guess would be that you want to put a graphic scale in your drawing title. If so, then I think your best option would be to call the same macro the NCS drawing titles use:

CALL "Graphic_Sc_NCS_drawTit" PARAMETERS gs_cont_pen=thinpen, gs_text_pen=gs_drawing_scale_font_pen, gs_text_size=gsfs,
                                         gs_text_style=fontType, ut=ut, cs=0, tr=1, drawingScale=drawingScale
But even if that is not the case, you can use a similar method the aforementioned macro uses to get the scale factor for the graphic scale - get it from the string.

Here's a way to do it with 1/4" = 1'-0" (but I am sure there are plenty of other ways):
if AC_DrawingScale = `1/4" = 1'-0"` then scale = 48
I hope this helped. Maybe you can even look into the script of "Graphic_Sc_NCS_drawTit" to see how it does it.

Regards,

Edit: I see Ling was faster than me. But his way of breaking down the string seems smarter than just matching it like I did. Go with that!
Daniel Alexander Kovacs

Professional Services Consultant

GRAPHISOFT



For Troubleshooting and useful Tips & Tricks visit
vfrontiers
Enthusiast
All good tips.. and I will attempt them...

Unfortunately, I can see a circumstance where if it is a TYPICAL SCALE, it may work... but there are too many possibles...
1/4" = 1'-0"
1"=20'
1:150

etc.... etc...
I may just try and cover the normal scales.....
but clearly, the INTEGER version works more easily...

Thanks for the input!
Duane

Visual Frontiers

AC25 :|: AC26 :|: AC27
:|: Enscape3.4:|:TwinMotion

DellXPS 4.7ghz i7:|: 8gb GPU 1070ti / Alienware M18 Laptop