Documentation
About Archicad's documenting tools, views, model filtering, layouts, publishing, etc.
SOLVED!

IFS expression not returning expected result

Josh Verran
Expert

I have an expression:

 

Screenshot 2021-10-21 155904.png

I am intended to use in an interactive schedule (Floor plan KEY), if an element has a description entered then show that, if not shows the name, if the name is blank as well (-) then show the complex profile name, if it's not a complex profile then show the composite name etc.

What I'm getting thou is "---" apart from the complex profile.

Screenshot 2021-10-21 160243.png

Now I haven't finished yet so I know the composite isn't showing up, but I would have thought the names and descriptions would show up.


GRAPHISOFT CERTIFIED ARCHICAD BIM MANAGER

ARCHICAD 18-27 | BIMcloud Basic | CI Tools | Grasshopper - Rhino | CloudCompare | Bluebeam

LinkedIn | www.creativespace.co.nz | Tauranga, New Zealand

Windows 10 Pro | Intel Core i9-9900K @3.60GHZ | 32Gb RAM | 2xSamsung S27F350 1920x1080 60Hz | Nvidia Quadro P2200 (5Gb)
13 REPLIES 13
Josh Verran
Expert

I have another query, I'm not sure my description alone will be clear enough but I think the example might be.

I want to know if you can have an IFS function that has multiple logical tests.

 

In the virtual model there are various elements that have 3 properties in particular that I want to display depending on their values.

 

I'll use phones as an example, as they are pretty standard internationally.

The 3 Properties are:

  • Manufacturer (eg Apple)
  • Product (eg iPhone)
  • Name (eg Mobile phone)

So if an element only has the name populated I want it to read "Mobile phone"

If the element has the Manufacturer and Name I want it to read "Apple Mobile Phone"

If the element has the Product and Name I want to read "iPhone Mobile Phone"

If the element has the Manufacturer, Product and Name I want it to read "Apple iPhone Mobile Phone"

 

Not a perfect example but hopefully conveys the idea.

I'll fill in the gaps for commas and spaces etc.

 


GRAPHISOFT CERTIFIED ARCHICAD BIM MANAGER

ARCHICAD 18-27 | BIMcloud Basic | CI Tools | Grasshopper - Rhino | CloudCompare | Bluebeam

LinkedIn | www.creativespace.co.nz | Tauranga, New Zealand

Windows 10 Pro | Intel Core i9-9900K @3.60GHZ | 32Gb RAM | 2xSamsung S27F350 1920x1080 60Hz | Nvidia Quadro P2200 (5Gb)

Rather than using IFS functions, can you create a 4th property that joins or merges the other three properties?

That way if they are blank they will be left out.

Then use the 4th result for what you want.

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

Thanks Barry

Yeah, something like that might work, the values aren't truly blank as they have a "-", by default. But for the first 3 properties I could have an IF to the effect of if it's "-" show nothing [ ("") ?] but if it's populated then show the value.


GRAPHISOFT CERTIFIED ARCHICAD BIM MANAGER

ARCHICAD 18-27 | BIMcloud Basic | CI Tools | Grasshopper - Rhino | CloudCompare | Bluebeam

LinkedIn | www.creativespace.co.nz | Tauranga, New Zealand

Windows 10 Pro | Intel Core i9-9900K @3.60GHZ | 32Gb RAM | 2xSamsung S27F350 1920x1080 60Hz | Nvidia Quadro P2200 (5Gb)

IFS ( AND ( {Property:Phases/Manufacturer} <> "", {Property:Phases/Product} <> "", {Property:Phases/Name} <> "" ), TEXTJOIN ( " ", TRUE, {Property:Phases/Manufacturer}, {Property:Phases/Product}, {Property:Phases/Name} ), AND ( {Property:Phases/Manufacturer} <> "", {Property:Phases/Name} <> "" ), TEXTJOIN ( " ", TRUE, {Property:Phases/Manufacturer}, {Property:Phases/Name} ), AND ( {Property:Phases/Product} <> "", {Property:Phases/Name} <> "" ), TEXTJOIN ( " ", TRUE, {Property:Phases/Manufacturer}, {Property:Phases/Name} ) )

 

The above assumes that all three custom properties are available for any element in question.

If any property is not available, the expression will fail. This is the reason that a sequence of three was used in the first question because for any element only one of the profiles would be available. Also the reason a fourth sequence combining everything would not be valid. If any of one of the three properties above would not be made available to a particular element, you would have to go to the sequence method again or just let it fail.

 

EDIT: Or a simpler method if this is what you had in mind???

TEXTJOIN ( " ", TRUE, {Property:Phases/Manufacturer}, {Property:Phases/Product}, {Property:Phases/Name} )

Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27