BIM Coordinator Program (INT) April 22, 2024
Find the next step in your career as a Graphisoft Certified BIM Coordinator!
Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Trying to use glob_modpar_name and glob_scale together

JGoode
Advocate
What I need is for a value to update when the scale of the object is changed.
if (override_size = 0) then
	LOCK "symbol_width"
	symbol_width = 0.07
	symbol_width_2 = symbol_width*glob_scale
	LOCK "symbol_width_2"
endif
The symbol_width_2 = symbol_width*glob_scale needs to work when the glob_scale is changed. When I tried an if statement it wouldn't work and came up with an error. How do I compose the IF statement using this?

EDIT:
if (GLOB_MODPAR_NAME = "glob_scale") then 
	symbol_width_2 = symbol_width*glob_scale
 endif 
This code doesn't seem to update it.

EDIT 2: When I change the scale with the option to enable the symbol width to be edited, the symbol width stays the same and massively distorts the symbol but when the option is not ticked then it all updates appropriately. Is it not possible to use glob_scale with glob_modpar_name to update and object?

All I need is for this code to work and it will be good enough for me
if (GLOB_MODPAR_NAME = 'GLOB_SCALE') then 
	override_size = 0
endif 
ArchiCAD 23

Windows 10
4 REPLIES 4
Anonymous
Not applicable
GLOB_MODPAR_NAME is a Parameter Scipt command,

in GDL for Archicad 21 it states

GLOB_SCALE works for :
2D Script
3D Script

Does not work for:
UI Script
Parameter Script
Property Script

so is a no go for Parameter commands like GLOB_MODPAR_NAME

it stopped working from Archicad 20
with a default value of 100 when used in the parameter script
JGoode
Advocate
allanp wrote:
GLOB_MODPAR_NAME is a Parameter Scipt command,

in GDL for Archicad 21 it states

GLOB_SCALE works for :
2D Script
3D Script

Does not work for:
UI Script
Parameter Script
Property Script

so is a no go for Parameter commands like GLOB_MODPAR_NAME

it stopped working from Archicad 20
with a default value of 100 when used in the parameter script
What about in the master script in Archicad 19? Is there any other way of making this work?
ArchiCAD 23

Windows 10
Barry Kelly
Moderator
GLOB_SCALE is not an object parameter so you don't need it use GLOB_MODPAR_NAME at all.

GLOB_SCALE can only be used in the 2D/3D scripts and you can then say in your 2D/3D script
symbol_width_2 = symbol_width*glob_scale
However you can not set the parameter value in the parameter list for 'symbol_width_2' because you can not set parameter values from the 2D/3D scripts - you can only override them.

So you won't be able to have a parameter in the object parameter list that changes according to the scale, but you can certainly have you object adjust according to the scale.

I am not really sure what you are trying to achieve so I hope this makes sense.

Barry.
One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Anonymous
Not applicable
Hi,

if you make 2 parameters
Point1_Drag_X
and
Temp_Point1_Drag_X
then
you drop this in the master script...


if GLOB_MODPAR_NAME = "Point1_Drag_X" then
Temp_Point1_Drag_X = Point1_Drag_X / GLOB_SCALE
parameters Temp_Point1_Drag_X = Temp_Point1_Drag_X
else
Point1_Drag_X = Temp_Point1_Drag_X * GLOB_SCALE
parameters Point1_Drag_X = Point1_Drag_X
endif
unid = 1000
hotspot2 0, 0, unid: unid = unid + 1
hotspot2 0, 0, unid, Point1_Drag_X, 1+128 : unid = unid + 1
hotspot2 Point1_Drag_X, 0, unid, Point1_Drag_X, 2 : unid = unid + 1
hotspot2 -1, 0, unid, Point1_Drag_X, 3 : unid = unid + 1

line2 0,0,Point1_Drag_X,0


If you drag the point/change Point1_Drag_X, the temp value update,
If you don't drag the point/change Point1_Drag_X, then the main value is made out of the temp value.

This does not work in 20, but does work in 19.
In Archicad 20 it believes that you are in the parameter script and the Glob_Scale value doesn't change(it is always set to 100)

Note:
The Parameters command updates the parameter in the list for the user to see.
you can change you value in the 2d, 3d script without having to push it back into the parameters and it will still be the scaled value.

are you using this as a draggable parameter...as set out there,
or
does it just need to be visible to the user,
or
does it just need to be displayed in the 2d/3d window?
Learn and get certified!