License Delivery maintenance is expected to occur on Saturday, November 30, between 8 AM and 11 AM CET. This may cause a short 3-hours outage in which license-related tasks: license key upload, download, update, SSA validation, access to the license pool and Graphisoft ID authentication may not function properly. We apologize for any inconvenience.
Collaboration with other software
About model and data exchange with 3rd party solutions: Revit, Solibri, dRofus, Bluebeam, structural analysis solutions, and IFC, BCF and DXF/DWG-based exchange, etc.

Question about Expressions

squall_tmo
Booster
Hi,

I'm trying to create a sort of code/info to export as a Name in IFC, but I can't use the Building Material in a CONCAT or a TEXTJOIN string...is it possible to do it some way?

this is more or less the expression I was trying to create:


IF (
ARCHICAD Classification - 22 = "Battiscopa"; 
TEXTJOIN ( " "; TRUE; "Battiscopa"; Building Material; "" 
)
ARCHICAD Classification - 22 and Building Material are extracted from the "Properties and Parameters" button.

I tried in a lot of different manners to convert it into a "real string":
I created another property with the Building Material to place it in my expression, I inserted it in a SPLITLEFT function and I tried with a lot of functions...but nothing.

I think that it's impossible that I can convert a number into a string and use it in a CONCAT but I can't use a property that is a string yet, like Building Material o Composite Structure name, the same way, so I probably went wrong someway...

Many thanks in advance for helping!
5 REPLIES 5
poco2013
Mentor
There is not sufficient info to determine a problem, but you might check the following:

1. The open and closing () must match -- you are missing a closing )
2. Strings are case sensitive unless you select otherwise.
3. Your classifications must match for both the expression and the element
4. Check that the property 'Build Material' is available for the element in question - its not available for walls. A easy way to check is to enter only the property with the correct data type 'string' -- and use the evaluate button -- look for a error message.
5. What element type are you checking? -- if I know that I could double check your formula
6. Properties must be entered via the dropdown icon not directly typed in. Check that their highlighted in gray?
7. Be sure your separator for your version is ; and not ,
Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27
squall_tmo
Booster
Dear Gerry,
Many thanks for answering!

the real code is the following (but it's little difficult to write it in an understandable way...)

TEXTJOIN (
""; TRUE;

IF ( {Property:ClassificationSystemPropertyDefinitionGroup/Classificazione ARCHICAD - 22} = "Battiscopa" ;
TEXTJOIN ( " "; TRUE; "Battiscopa"; {Property:Parametri Generali/Materiale da Costruzione} );
"" );

IF (
{Property:ClassificationSystemPropertyDefinitionGroup/Classificazione ARCHICAD - 22} = "Muro";
{Property:Parametri Generali/Struttura Composta}; "" )
)


I tried to make it a little easier to understand by changing color to the properties I took from the "Parameters and Properties" button (anyway by coping and pasting the code above in an Italian version of ARCHICAD you should obtain the correct properties connections)

TEXTJOIN (
""; TRUE;

IF ( {Property:ClassificationSystemPropertyDefinitionGroup/Classificazione ARCHICAD - 22} = "Battiscopa" ;
TEXTJOIN ( " "; TRUE; "Battiscopa"; {Property:Parametri Generali/Materiale da Costruzione} );
"" );

IF (
{Property:ClassificationSystemPropertyDefinitionGroup/Classificazione ARCHICAD - 22} = "Muro";
{Property:Parametri Generali/Struttura Composta}; "" )
)


Everything works correctly once that I replace {Property:Parametri Generali/Materiale da Costruzione} and {Property:Parametri Generali/Struttura Composta} with a simple string, for example "A" and "B"...
So my problem is that I don't know how to convert them into "true" strings!

Many thanks again!
poco2013
Mentor
I don't see anything obviously wrong:

so - a couple of points that I'll go back over.

'Building Material' is a string so there is no reason to convert it. Should work as is. i assume the data type is defined as string? Probably Building Material it is not available for the element and style of wall you are trying to attach -- it's not available for complex profiles.
Check for a yellow info tag. If it is not present everything is OK and the problem is either that your classifications are not correct or the property Building Material is not available for the element you are testing.

That's why i asked what element you are try to use this expression for -- So I could test it for you.

one point -- You should use the old classification 21 classes - 22 seems to have some problems.
Also select the element the before hand and then use the evaluate button -- that will tell you the error and what to look for?
Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27
squall_tmo
Booster
Many thanks Gerry!

I modified a little both classification systems, 21 and 22, to add the "Battiscopa" classification (that in english sounds like "Skirting"), so they aren't exactly the originals.

I created a skirting with the Wall tool and I assigned it the "Battiscopa" classification in both systems.

I selected it and I opened the Property Manager and I tried to make the script a little more complete inserting an "OR" statement to include both classification systems.

the result is something like Picture01.jpg

The script didn't report any error, but the result was "---" (as in Picture02.jpg).

So I tried to replace Building Material and Composite Structure with two simple strings: "_A_" and "_B_" (see Picture03.jpg).
ARCHICAD answer correctly in this case (I cannot place other pictures but when I evaluate the value of the expression, the answer is "Battiscopa _A_", that is the right answer).

I created a similar rule for "wall" and "slab" classification (to try with the standard Classification System) in a new file simply placing a wall and a slab and I obtained the very same result...so maybe Building Material and Composite Structure cannot be used in this kind of statement?
poco2013
Mentor
I don't see any errors in your expressions which would indicate a problem with availability-- but a couple of points.

Building material is only available for 'basic' walls or slabs, Composite Structure for 'composites'
complex profiles for a 'complex profile' wall or slab.

Also note that if ANY property in your expression is invalid (unavailable) the expression will not be evaluated even if the unavailable properties are not reached in your expression. A unavailable property anywhere renders the whole expression unavailable. Therefore you can not have both a 'building material' return value and a 'composite' in the same expression because the object is always one or the other.

You would have to do this with separate expression statements in a sequence. Archicad will only execute the applicable expression for the linked object in a sequence.

EDIT: it appears that you just want to return the material skin -- so the sequence would simply be as follows. The classification logicals are not needed if the expression classification is set appropriately. Archicad will only apply to elements with the same classification. See attachment jpeg
Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27