We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2021-11-17 12:39 AM - last edited on 2022-09-30 04:19 PM by Oleksandra Vakariuk
Hi all,
I'm quite new having just switched from Revit to Archicad and I want to learn more about expressions. I'm struggling here with this. I'd like to write an expression to take the Zone (element ID) and if it contains "EX" in it I want it to return 0 and if not, return the area.
I'd also like to write an expression that says if the zone says "EX" then exemption says "SMC 23.45.510.D.10". As of right now, I've just copied and pasted.
If any of you know of resources where I can learn more about expressions, I'd greatly appreciate it. Thanks
2021-11-17 02:00 AM
Hi there
I'm sure one of the other more experienced users can solve this for you with more details.
In the interim thou something like this might be a start.
IF(Zone Name = "Ex","0","Other Text")
Since your values don't actually = Ex they contain Ex, I think you will need to replace the bold text above with a "Contains" function.
2021-11-17 02:35 AM - edited 2021-11-17 02:52 AM
Actually you could try this, have one property that extracts the first two characters of a property (in this case that would be extracting "EX").
Then have another property that says if property = "Ex", then show the text you mentioned, if not then show 0.
Below will hopefully help. I have used a property called "Name/Type" where as yours would probably be the zone name.
I'd be interested to see how the Contains function could be utilised, I tried by saying if the text contained EX then return a True or False result, but then I couldn't use that as an argument in the original expression as had different data type. You could probably convert that to text, but I'm sure theres a simpler method. Cool to have a play around and find different methods to extract info.
2021-11-17 08:56 AM
This could be simplified more by using a STRING FROM LEFT function inside an IF statement to find the first two letters and return a specific result if it contains 'EX'.
IF ( LEFT ( Zone Name, 2 ) = "EX", "SMC 23.45.510.D.10", "" )
And for the area:
IF ( LEFT ( Zone Name, 2 ) = "EX", 0m2, Measured Area )
Only one property is needed for each with this method.
There is a lot of information about functions in the online reference guide which I've found very useful - https://helpcenter.graphisoft.com/user-guide-chapter/86540/