We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2022-10-31 11:16 AM
Hello,
I need some help. I'm trying to make an expression based property that changes it's value if I change a value from an option set property. I have an option set 'Unit' with options; (M2, M3, M, KG, Item) and another property 'Quantity'. I'd want when I change the "Unit" option to 'M2', for example, The "Quantity" value reads the Area of an element, and if I change to 'M3', the "Quantity" value reads the Volume of the element.
I'll appreciate your feedbacks. Kind regards.
2022-11-01 09:00 AM - edited 2022-11-01 09:04 AM
I would use "IFS" statement and start working the expression around that. Also the data type of the expression I would keep as "string" because there are multiple different types of data that expression must be able to handle with one script.
Here's the idea. First "Unit=xx" is a logical condition and second is the the retrieved value determined by the logical condition. Just add other unit types to end of the IFS-script with the same way as m² and m³. Also use STRCALCUNIT to handle retrieved values as a string.
In the picture above I also used "concat"-function to join measured value and unit of measurement (as a string) together but that function is not necessary if you don't want to show unit of measurement in the end of the calculated value.
Hope this helps!
-JT