The Global ARCHICAD Community

Stay informed. Get help. Share your knowledge.

Plan, Section, Elevation, Schedule, Layouting...

Moderators: Karl Ottenstein, LaszloNagy, ejrolon, Barry Kelly, gkmethy

User avatar
By poco2013
#283645
At present, within expressions- version 22 , all parts of the expression must be valid in order for the function (expression) to be evaluated.

The effect of this is to require that within a IF statement that both the TRUE and FALSE paths must be applicable to the object referenced. Therefore there is no way to chain IF statements since a invalid False will abort the IF statement and the TRUE path will never be tested even if it is valid.

As I understand it, this is by design.

Would like to have a 'SKIP' function which would allow the logic to move to a second / third/etc. line of logic as is used (somewhat) in the 'sequence' field.

This would allow a 'backdoor' method to simulate a SELECT statement within expressions and provide additional uses.
User avatar
By Barry Kelly
#283654
Are you sure?
Here is a little expression I made that checks for a certain wall thickness and then checks for various names in the composite structure to give me a construction type ("Face - modular", "Timer frame", etc.) and only if it does not meet any of these requirements will it give a "N/A" result.
So it will continue through the IF statements even when there is not a match.
It is a matter of nesting one IF statement inside another.

Code: Select allIF ( AND ( {Property:Wall/Thickness of the Wall (ARCHICAD 21)} >= 70 mm, {Property:Wall/Thickness of the Wall (ARCHICAD 21)} <= 160 mm ), IF ( FIND ( "face_90", {Property:General Parameters/Composite Structure}, 1, FALSE ) > 1, "Face - modular", IF ( FIND ( "face110", {Property:General Parameters/Composite Structure}, 1, FALSE ) > 1, "Face - standard", IF ( FIND ( "face", {Property:General Parameters/Composite Structure}, 1, FALSE ) > 1, "Face - undetermined", IF ( FIND ( "render", {Property:General Parameters/Composite Structure}, 1, FALSE ) > 1, "Common", IF ( FIND ( "plaster", {Property:General Parameters/Composite Structure}, 1, FALSE ) > 1, "Common", IF ( FIND ( "common", {Property:General Parameters/Composite Structure}, 1, FALSE ) > 1, "Common", IF ( FIND ( "steel", {Property:General Parameters/Composite Structure}, 1, FALSE ) > 1, "Steel frame", IF ( FIND ( "timber", {Property:General Parameters/Composite Structure}, 1, FALSE ) > 1, "Timber frame", IF ( FIND ( "master wall 100", {Property:General Parameters/Composite Structure}, 1, FALSE ) > 1, "Master wall 100", "N/A" ) ) ) ) ) ) ) ) ), "N/A" )
So simplified I think it will be something like this.
Code: Select allIF ( Logical, ValueIfTrue, IF ( Logical, ValueIfTrue, IF ( Logical, ValueIfTrue, IF ( Logical, ValueIfTrue, ValueIfFalse )))ValueIfFalse )

Barry.
User avatar
By poco2013
#283660
Hadn't thought of your approach which, in effect, creates a one line expression which, I think, could cause a user to get lost in the logic and would be prone to typing errors which would be difficult to find.

Still think a 'skip' function would be a better approach which would allow multiple lines and would be clearer to the user as to the logic flow and thus be less error prone.

That said, your approach with the resources allowed is a great idea and one I could use immediately.

Thanks so much for the suggestion -- It will help a lot!!!

P.S Curious as to the format of using "Property: General Parameter/Composite Structure" could you fill me in as to its rules for usage. I currently pick from the menus. Is this a alternate method?