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

Expressions that ignore calculation units

KatherineC97
Booster

I'm using an expression to get an autotext value which should end up as 3.5mm, but because I have my calculation unit for length as 0 decimals it's showing as 4mm. Is there a way around this, because I don't want to change the calculation units for the whole project. I've tried messing around with data conversion in the expression sequence, but I've never used them before so I feel like I'm probably missing something.

1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Barry Kelly
Moderator

@KatherineC97 ,

This is just off the top of my head - I haven't tested.

 

You must have an expression that calculates the veneer width, something like ... (width-core width)/2 ?

This should give you a figure with the correct decimals.

But as it is a length, when you concert it to a string, it will use the calculation units, and as you have no decimals it will round.

 

So the trick may be to convert the length to a number.

((width-core width)/2)/1mm

 

This should now give you a number with the correct decimals.

Now you can convert that number to a string and you can nominate the number of decimals ... STR ( Value, [NumberOfDecimals] )

 

 

I hope that will work.

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

View solution in original post

7 REPLIES 7
Kevin Lee
Enthusiast

I think you are trying to do something interesting here but can I ask how you've managed to model 3.5mm of "something" when the calculation is set to the whole number?

 

Also, what element needs to be modelled 3.5mm in ArchiCAD?

Kevin Lee | Director of Technology | BIM
TZG Architects
ARCHICAD 27 | GDL | Rhino.GH | Solibri | Twinmotion
Mac Studio-M2 24‑core CPU | 60‑core GPU | 128GB memory

It's the veneer thickness for a column. I'm trying to make an autotext note so that it's easy to update, but there isn't an option for the veneer thickness as an autotext, so I'm using an expression instead, but the 4mm showing should be 3.5

 

KatherineC97_0-1677130286126.png

 

Kevin Lee
Enthusiast

Screenshot 2023-02-23 at 4.49.17 pm.png

 

I see, so we are on the same page, are you entering the veneer thickness in the column setting's window? I just want to know where "3.5mm" is coming from.

Kevin Lee | Director of Technology | BIM
TZG Architects
ARCHICAD 27 | GDL | Rhino.GH | Solibri | Twinmotion
Mac Studio-M2 24‑core CPU | 60‑core GPU | 128GB memory

Yep, that's it 

Kevin Lee
Enthusiast

yes, I couldn't find an option to auto-text the veneer thickness.

 

there were few values in the schedule that pulls out the area of the bottom surface and veneer surface area. so if we use some mathematical equation, we could extract the veneer thickness but I was still getting it as the round number. well, in this instance, I would just create a new property of string (or list of veneer thickness under column specification and add it to the expression. example below.

 

CONCAT ( STRCALCUNIT ( {Property:Column/Core Width} ), " x ", STRCALCUNIT ( {Property:Column/Core Height \/ Diameter} ), " x ", {Property:veneer_thk}, " SHS POST" )

 

attached is the property with the expression. 

Kevin Lee | Director of Technology | BIM
TZG Architects
ARCHICAD 27 | GDL | Rhino.GH | Solibri | Twinmotion
Mac Studio-M2 24‑core CPU | 60‑core GPU | 128GB memory
Solution
Barry Kelly
Moderator

@KatherineC97 ,

This is just off the top of my head - I haven't tested.

 

You must have an expression that calculates the veneer width, something like ... (width-core width)/2 ?

This should give you a figure with the correct decimals.

But as it is a length, when you concert it to a string, it will use the calculation units, and as you have no decimals it will round.

 

So the trick may be to convert the length to a number.

((width-core width)/2)/1mm

 

This should now give you a number with the correct decimals.

Now you can convert that number to a string and you can nominate the number of decimals ... STR ( Value, [NumberOfDecimals] )

 

 

I hope that will work.

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Kevin Lee
Enthusiast

That does work 🙂

@Barry Kelly 😀

 

Screen Shot 2023-02-23 at 7.10.18 pm.png

Kevin Lee | Director of Technology | BIM
TZG Architects
ARCHICAD 27 | GDL | Rhino.GH | Solibri | Twinmotion
Mac Studio-M2 24‑core CPU | 60‑core GPU | 128GB memory