Wishes forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Global Variable (or REQUEST) needed for scale

vfrontiers
Contributor
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
AC22 6021:|: AC24 4007:|: Enscape3:|:TwinMotion
DellXPS 4.7ghz i7:|: 8gb GPU 1070ti
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 25 USA and earlier   •   MacOS 11.6.1, iMac Pro

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
AC24 USA • iMac 27" 4.0GHz Quad-core i7 | 24 gb ram • MacBook Pro 2.8GHz | 16 gb ram • OSX10.14.6

Daniel Kovacs
Graphisoft
Graphisoft
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
Contributor
That is not my experience...

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

Unless this changed in AC22???

d.
Duane
Visual Frontiers
AC22 6021:|: AC24 4007:|: Enscape3:|:TwinMotion
DellXPS 4.7ghz i7:|: 8gb GPU 1070ti

Daniel Kovacs
Graphisoft
Graphisoft
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
Contributor
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
AC22 6021:|: AC24 4007:|: Enscape3:|:TwinMotion
DellXPS 4.7ghz i7:|: 8gb GPU 1070ti

Lingwisyer
Virtuoso
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.
AC18-23 AUS 7000
Self-taught, bend it till it breaks.
Win10 | E5620 x 2 | 24GB | K2200

Daniel Kovacs
Graphisoft
Graphisoft
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
Contributor
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
AC22 6021:|: AC24 4007:|: Enscape3:|:TwinMotion
DellXPS 4.7ghz i7:|: 8gb GPU 1070ti

vfrontiers
Contributor
Ok... I used the LOOKUP table version (long hand if... then)… And it seemed to work, but here's what I noticed...

If I CHANGE the scale of the drawing, the if .. then does NOT recalculate... so my graphic scale is inaccurate.

I know there is something about MODPAR that may be able to help me... but I'll have to save it for another day...
Duane
Visual Frontiers
AC22 6021:|: AC24 4007:|: Enscape3:|:TwinMotion
DellXPS 4.7ghz i7:|: 8gb GPU 1070ti

Lingwisyer
Virtuoso
Another note is that AC_DRAWING_SCALE is only available for Drawing Titles...



Ling.
AC18-23 AUS 7000
Self-taught, bend it till it breaks.
Win10 | E5620 x 2 | 24GB | K2200

Start a new conversation!

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!