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.

Help with script

Anonymous
Not applicable
I may be being stupid but, I hope that someone v. kind can assist.

I have two variables h and lg, both controlled by user input and by hotspots in 3D. h is always less than lg, but the difference between the variables is not always the same, because the user can set either independently.

BUT... I want the difference between the two variables to remain the same when the user varies the larger of the two i.e. lg. The problem seems to be that if I establish the relationship, any increase in lg automatically affects the difference. I have tried PUTs and GETs but this one has me completely stumped.

Can anyone, PLEASE, help?
13 REPLIES 13
Rob
Graphisoft
Graphisoft
Mike,

I am sorry I did not really pay enough attention when I wrote the reply yesterday.

the script in the parameter script window should go like this:

VALUES "lg" RANGE [0,h)
IF GLOB_MODPAR_NAME="h" THEN PARAMETERS lg=h-old_diff
IF GLOB_MODPAR_NAME="lg" THEN PARAMETERS h=lg+old_diff,old_diff=h-lg

the first line limits the lg values to 0<=lg<h otherwise when lg>h you would get the error message
::rk
Anonymous
Not applicable
Rob

That doesn't seem to work 100% either! The problem I now encounter is that there seems to be a restriction on the parameter lg. It's v. difficult to describe. I now find that changing lg also changes h, which is not what I want to do, I want lg to be changeable without affecting h, and h to change whilst affecting lg!

Ho-hum, I am beginning to lose heart, but thanks, once again, for your suggestion.

Mike
Anonymous
Not applicable
Mike,

Try this. not sure if i understood correctly the relationship priorites you want within your object.
Not fully tested, some weaks in case of minimal values, but hope this can help.
Anonymous
Not applicable
Eureka! That script works.

Now I need to change the angles, and control the variables to prevent impossible conditions, but I reckon I can do that.

Thank you, Olivier and all contributors - my quest is over!!