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

setting parameter via scripting

Anonymous
Not applicable
howdy

looking to do the following

i have an if/ then statement and depending upon the result i would like to have gdl modify one of the parameters of the object

the parameter in question can also be modified by hand

in principle i want the object to check if the initial value of the parameter is greater than one number or less than another... and if so... then auto change the parameter to a specific value... if not.. then leave as is

also

if the value is modified by hand... for there to be an error check to ensure that the value is within range... if not... produce an error dialog

make sense?

any help would be greatly appreciated

thanks

yukioMishima
5 REPLIES 5
Anonymous
Not applicable
i think i understand what you mean.
try something like:

IF paraName>10 THEN ......
.....
ELSE
........
ENDIF
rocorona
Booster
You have to place the commands in the PARAMETERS script, or in the MASTER script.

You can use the VALUES command, with the CUSTOM keyword, to let the user input a desired value, and the RANGE limitation, that revert this value if is out of the allowed field.

Or something like this:
IF param > 100 THEN
PARAMETERS param = 100
ELSE
IF PARAMETERS < 10 THEN
PARAMETERS param = 10
ENDIF
ENDIF


I suggest NOT using the alert window, or not abusing of it, as it is very annoyng for the user.
_________________

--Roberto Corona--
www.archiradar.com
AC18 - ITA full on Win10
_________________
_________________
Anonymous
Not applicable
Hello,

This allows custom values within the range and any of the hard coded values.

values "paraName" (-5), 0, 1, 2, a/2, range[-3,10]


Regards, Juha
Anonymous
Not applicable
thanks for all the replies

i was using an IF statement but the parameter did not seem to get set when i asked it to

i will work thru each suggestion and see if i can get it to work

i will report back once done

thanks again

yukioMishima
Anonymous
Not applicable
Hello,

Setting the parameter does not always update the value inside
the code. Might be useful to code like;

if paraName > 100 then
paraName = 100 !<--setting the value for the rest of the code
parameters paraName= paraName !<--setting the value for the user
endif


--
Regards, Juha