Document & Visualize forum
cancel
Showing results for 
Search instead for 
Did you mean: 

IFS expression not returning expected result

Josh Verran
Advocate

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.

ARCHICAD 18-25 | BIMcloud Basic | CI Tools - CI Extension by Central Innovation | Windows 10 Pro | Intel Core i7-6700K @4.00GHZ | 32Gb RAM | Dual Samsung S27F350 1920x1080 | Nvidia Quadro P2200 5Gb
1 ACCEPTED SOLUTION

Solution

IF I understand your sequence --you want either description, name, complex profile, composite, building material in that order. don't know what CBI is?

 

expressions_3.PNG

 

 

Gerry

Windows 10 - Visual Studio 2019; ArchiCAD 25

View solution in original post

13 REPLIES 13

poco2013
Advisor

A item that you might want to check. If are getting --- results, that can mean that one or more attributed in your IFS statement is not applicable to your element. It does not matter if that attribute can not be reached, Any inappropriate attribute will invalidate the whole clause.

 

A workaround is to break up your statement into separate sequences. Archicad will use the first one that is appropriate.

Gerry

Windows 10 - Visual Studio 2019; ArchiCAD 25

Josh Verran
Advocate

Ah, thanks Gerry, that will be it.

ARCHICAD 18-25 | BIMcloud Basic | CI Tools - CI Extension by Central Innovation | Windows 10 Pro | Intel Core i7-6700K @4.00GHZ | 32Gb RAM | Dual Samsung S27F350 1920x1080 | Nvidia Quadro P2200 5Gb

Josh Verran
Advocate

I've checked and altered slightly but still not getting the desired result.

The Property references two properties that I have created (ie Name/type, Description) both of these are available for all classifications.

I have added these as two separate lines in the expression.

Underneath those I have entered the built in paramater for complex profile, composite etc.

 

I did a quick screen recording which you can see below, hopefully this my shine some light on what I'm getting wrong.

 

https://youtu.be/Dl8yBDdslJE

 

ARCHICAD 18-25 | BIMcloud Basic | CI Tools - CI Extension by Central Innovation | Windows 10 Pro | Intel Core i7-6700K @4.00GHZ | 32Gb RAM | Dual Samsung S27F350 1920x1080 | Nvidia Quadro P2200 5Gb

Josh Verran
Advocate

What I'm hoping for is if a staff member draws an element, let's say a wall (using composite), the key will automatically show the composite name, however perhaps there's one wall that they want to write in a manual note/description for whatever reason, the key will now show that info instead of the composite name.

 

Another scenario would be a staff member places a toilet and gas bottles, the toilet favourite just has the name entered "toilet". The gas bottles favourite has the "name" and the "description". The description is required to show for the gas bottles, but since the toilet has no description only the name shows.

Lastly, if there's no name and no description then the classification name will show, for the example of the gas bottles that would be "Gas supply cylinder systems" [CBI - 7212 - Gas supply cylinder systems].

ARCHICAD 18-25 | BIMcloud Basic | CI Tools - CI Extension by Central Innovation | Windows 10 Pro | Intel Core i7-6700K @4.00GHZ | 32Gb RAM | Dual Samsung S27F350 1920x1080 | Nvidia Quadro P2200 5Gb

Josh Verran
Advocate

I could create separate properties.

Something like:

Property 1 is IF (description <> "-", description, Property 2).

Then in Property 2 have IF (name <> "-", name, Property 3)

Then in Property 3 have the list of expressions for Complex profile etc

 

Just hoping to get it done in one expression if possible.

ARCHICAD 18-25 | BIMcloud Basic | CI Tools - CI Extension by Central Innovation | Windows 10 Pro | Intel Core i7-6700K @4.00GHZ | 32Gb RAM | Dual Samsung S27F350 1920x1080 | Nvidia Quadro P2200 5Gb

Not sure a understand how you want display the data. But if you want to test  the description field based on a blank field it should be description <> ""

Gerry

Windows 10 - Visual Studio 2019; ArchiCAD 25

Hi Gerry

By default the description property has "-" entered.

I'm wanting the new property to read the Description if there is one entered (so not the default) and if there is no description entered (Default "-") then the property would read what's written in the name field.

 

Thats the gist of of the beggining anyway, I have a bit of hierarchy in mind of subsequent info to show if the above is not available.

ARCHICAD 18-25 | BIMcloud Basic | CI Tools - CI Extension by Central Innovation | Windows 10 Pro | Intel Core i7-6700K @4.00GHZ | 32Gb RAM | Dual Samsung S27F350 1920x1080 | Nvidia Quadro P2200 5Gb

Solution

IF I understand your sequence --you want either description, name, complex profile, composite, building material in that order. don't know what CBI is?

 

expressions_3.PNG

 

 

Gerry

Windows 10 - Visual Studio 2019; ArchiCAD 25

View solution in original post

Thanks Gerry, we have a winner!

ARCHICAD 18-25 | BIMcloud Basic | CI Tools - CI Extension by Central Innovation | Windows 10 Pro | Intel Core i7-6700K @4.00GHZ | 32Gb RAM | Dual Samsung S27F350 1920x1080 | Nvidia Quadro P2200 5Gb

Josh Verran
Advocate

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.

 

ARCHICAD 18-25 | BIMcloud Basic | CI Tools - CI Extension by Central Innovation | Windows 10 Pro | Intel Core i7-6700K @4.00GHZ | 32Gb RAM | Dual Samsung S27F350 1920x1080 | 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 25
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision 3510 - i7 6820HQ @ 2.70GHz, 16GB RAM, AMD FirePro W5130M, Windows 10

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.

ARCHICAD 18-25 | BIMcloud Basic | CI Tools - CI Extension by Central Innovation | Windows 10 Pro | Intel Core i7-6700K @4.00GHZ | 32Gb RAM | Dual Samsung S27F350 1920x1080 | 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 10 - Visual Studio 2019; ArchiCAD 25

Start a new conversation!

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!