We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

Project data & BIM
About BIM-based management of attributes, schedules, templates, favorites, hotlinks, projects in general, quality assurance, etc.

How do I write this expression the Archicad way?

Mats Knutsson
Advocate

I have a string property "House" as option set with A,B,C as values.

I want to write an expression for the property "FM" like below:

 

 

IF
home story =1 AND House = A THEN FM = "A1"
ELSEIF 
home story =2 AND House = A THEN FM = "A2"
ELSEIF
home story =1 AND House = B THEN FM = "B1"
ELSE FM="no value"
ENDIF

 

 

I tried just a two basic IF - AND expressions but I am doing something wrong...what could it be?

 

IF ( AND ( Home Story Number = 1; House = "A" ); "1A"; "-" )

IF ( AND ( Home Story Number = 2; House = "A" ); "2A"; "-" )

 

The first IF sentence decides everything and gives FM=1A for everything on story 1 with House = A but for all others it returns "no value"...

 

3 REPLIES 3
DGSketcher
Legend

With Properties they handle IF differently for multiple conditions. Have a look at THIS.

 

In your examples you are also using ; instead of a basic , between arguments.

Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)

Got it. Thanx! I did try IFS at first but couldn't get it to work... It was becuse I used too many brackets.

I'd like more examples in the GS learning material...like my code below.

I'm on Swedish Windows and we use ; instead of ,   (highly irritating when trying to follow international tutorials).

 

IFS
  (
      AND ( Home Story Number = 1; House = "C" ); "1C";
      AND ( Home Story Number = 2; House = "C" ); "2C"
   )
Yves
Advocate

Hi,
We could also write it simply like this

CONCAT ( {Property:Généralités/House}; STR ( {Property:Paramètres généraux/Numéro d'étage d'implantation}; 0 ) )

Or better

IF ( ISUNDEFINED ( {Property:Généralités/House} ); "-"; CONCAT ( {Property:Généralités/House}; STR ( {Property:Paramètres généraux/Numéro d'étage d'implantation}; 0 ) ) )

 

 

 

Yves Houssier
Belgium
Archicad 19 -> 24
iMac - Mac Os 10,13