2023-02-23 04:10 AM - last edited on 2023-05-16 11:31 PM by Gordana Radonic
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.
Solved! Go to Solution.
2023-02-23 08:35 AM
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.
2023-02-23 06:25 AM
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?
2023-02-23 06:36 AM
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
2023-02-23 06:50 AM
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.
2023-02-23 06:58 AM
Yep, that's it
2023-02-23 07:31 AM
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.
2023-02-23 08:35 AM
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.
2023-02-23 09:11 AM
That does work 🙂