We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

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

Scale sensitivity not updating

Gary Lawes
Participant
Hi All,

I have a simple 2D object that I wish to be scale sensitive. However it does not update itself automatically when the drawing scale is changed. If I open the object dialogue dialogue box and close it, the object updates as I would expect it to, but it does not react to a change in drawing scale automatically as it should.

My question is. Has a setting been introduced that controls whether or not an object reacts to a scale change. If so what is it?

Thanks

Gary
AC 17
Windows 7 Pro
Intel i7-2600
16GB RAM
11 REPLIES 11
Does Your object check GLOB_SCALE?

Find any scale sensitive object and look for the GLOB_SCALE and implement in Your object.

Best Regards,
Piotr
Gary Lawes
Participant
Yes Piotr, it is using GLOB_SCALE to obtain the current view scale. And as I stated it all works fine except that it does not update automatically when the scale is changed. It only updates when the object dialogue ox is opened and then closed. I have tried a rebuild of the drawing but again this does not work.
Thanks
Gary
AC 17
Windows 7 Pro
Intel i7-2600
16GB RAM
Anonymous
Not applicable
Hello,

Could you post the object or the code?
Anonymous
Not applicable
Gary,
are you changing the scale of a drawing placed in a layout? if so the scale sensitivity will not work.
You need to change the scale in the saved view and rebuild the view to change the display
Scott
Gary Lawes
Participant
Hi Scott,

No it is not in a layout. I am changing scale within the drawing view.

I will post the code tomorrow, and maybe put a video on YouTube to help clarify.

cheers

Gary
AC 17
Windows 7 Pro
Intel i7-2600
16GB RAM
Gary Lawes
Participant
GDL code below -

Master script -



!Minor scale increments

PARAMETERS scale_step = act_bar_wid*Draw_scale/10 !Width of main scale blocks

min_scal = scale_step/5 !Width of small scale increments in first block

If scale_step < 1 then txt_siz_mult = 1000 else txt_siz_mult = 1


And The 2D Script -

pen Fill_pen_2


While NFD < 5 Do
wid = min_scal
dep = min_scal
fill_type = gs_fill_type
fill_pen = Fill_pen_1
!GOTO 5
Gosub 10
Add2 0,-dep
fill_pen = Fill_pen_2
Gosub 10
Del 1

Add2 wid, 0
NFD = NFD+1
Mul2 1,-1


EndWhile
Hotspot2 0,0

NFD = 0

While NFD < 5 Do

wid = scale_step
dep = min_scal
fill_type = gs_fill_type
fill_pen = Fill_pen_1

Gosub 10
Add2 0,-dep
fill_pen = Fill_pen_2
Gosub 10
Del 1

Add2 wid, 0
NFD = NFD+1
Mul2 1,-1
Hotspot2 0,0

EndWhile

Del top

If lab_txt = 1 Then
Add2 0, -dep*1.5
txt_pos = 1
txt_val = "Scale 1:"+ str(Draw_scale, 3, 0)
Gosub 30
EndIf
Del top
!*******************
!Add distance values
NFD = 0
Add2 0,dep
While NFD <7 Do
txt_val = scale_step*NFD* txt_siz_mult
txt_pos = 8

Gosub 30
NFD = NFD+1
Add2 wid, 0
EndWhile
Del Top
End
!*****************************************************************************
10:
!Fill
fill fill_type

poly2_b 5,3,fill_pen, fill_pen,
0,0,1,
wid,0,1,
wid, dep,1,
0,dep,1,
0,0,-1

Hotline2 0, 0, wid, 0

Return
!*****************************************************************************
30:
!Label text

pen txt_pen

Define Style txt "Arial Western",txt_ht,txt_pos, 0
style txt

If V~ = 1 Then Mul2 -1,-1 !Correct text for mirrored object
TEXT2 0, 0, txt_val
Return
AC 17
Windows 7 Pro
Intel i7-2600
16GB RAM
Gary Lawes
Participant
Ooops! Ignore that last posting (with the script) as it is not the correct object.

Sorry.
AC 17
Windows 7 Pro
Intel i7-2600
16GB RAM
Gary Lawes
Participant
So this is the important bit. In the Master script -

If Auto_scal = 1 Then
PARAMETERS Draw_scale = GLOB_SCALE
HIDEPARAMETER "Draw_scale"
Else
Values "Draw_scale" 2, 5, 10, 20, 50, 100, 200, 500, 1250
EndIf

!Minor scale increments

PARAMETERS scale_step = act_bar_wid*Draw_scale/10 !Width of main scale blocks

min_scal = scale_step/5 !Width of small scale increments in first block

If scale_step < 1 then txt_siz_mult = 1000 else txt_siz_mult = 1


I have put this video up on Youtube that shows the issue. When I change the view scale, the object remains unchanged until I open and close its dialogue box. This is the link -

https://www.youtube.com/watch?v=-78NuP0CnC0&feature=youtu.be

I hope that helps and thank you all for your input.

Gary
AC 17
Windows 7 Pro
Intel i7-2600
16GB RAM
Barry Kelly
Moderator
You will need to type ...

Draw_scale = GLOB_SCALE
PARAMETERS Draw_scale = Draw_scale


Just setting the parameter does not actually set the variable value for use in the script - which is why you have to open the object so it can read the parameter value.

You will need to do the same for the 'scale_step' parameter as well.
Always set the parameter value first and then set the actual parameter.

i.e.
scale_step = act_bar_wid*Draw_scale/10
PARAMETERS scale_step = scale_step


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