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

How to store values for later use?

Palawat
Advocate
Hi,

My situation can be simplified to something like this. I'd like to store the values "A" and then turn it into previousA. And then store the values of "A" again when user change it, and turn it into currentA. So I can do something like:

differentA = previousA - currentA

Is there a way to do this?
Archicad 26, Windows 10, Corei7 3.4 GHz, 16 GB Ram.
https://www.indigofigs.com
https://www.facebook.com/indigofigs
2 REPLIES 2
Barry Kelly
Moderator
Create parameters for ‘previous_A’ and 'difference_A'
Create a boolean parameter called ‘set_previous’
You don’t need a parameter for ‘current_A’ because that is ‘A’



if set_previous = 0 then
previous_A = A
PARAMETERS previous_A = previous_A
set_previous = 1
PARAMETERS set_previous = set_previous
endif


difference_A = previous_A - A
PARAMETERS difference_A = difference_A


This will constantly give you the difference based on the original ‘previous_A’.
Now you can set a new value for ‘A’ and turn off the ‘set-previous’ switch and it will reset the ‘previous_A’ value and the switch will instantly turn back on again.
Type in a new value for A and you will have a new difference.

Not quite sure what you would want this for but it will work.

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
Palawat
Advocate
Thank you so much for your quick reply, Barry. I'll test/apply your idea asap.
Archicad 26, Windows 10, Corei7 3.4 GHz, 16 GB Ram.
https://www.indigofigs.com
https://www.facebook.com/indigofigs