We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

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.

Incremental for Lumber - IF function

Red
Advocate
I have searched around for a solution, but I have yet to find one. I know it is more than likely something small I am overlooking. I am trying to get an expression to generate the length of a beam and provide the correct lumber length for imperial sized lumber.

For example: ( I use separate lines when writing expressions out. In my opinion, it is a lot easier to read)

( IFS (
{Property:Beam/Length Left} <= 8 ', 8 ',
{Property:Beam/Length Left} >= 8'-1", 10 ',
***when it get to this stage and beyond, I need a >= 8'-1" like above and then a <= 9'-11", 10'***
{Property:Beam/Length Left} >= 10'-1", 12 ',
{Property:Beam/Length Left} >= 12'-1", 14 ',
{Property:Beam/Length Left} >= 14'-1", 16 ',
{Property:Beam/Length Left} >= 16'-1", 18 ',
{Property:Beam/Length Left} >= 18'-1", 20 ' ) ) ), 0 )

I can get one to work with just an IF function, but I hit a roadblock when I try several entries.
Thanks,
Red
i7 8700k
ROG Strix Z390-E MoBo
64gb RAM
EVGA GeForce GTX 2080
_______________________
http://www.facebook.com/flatcreekdesignstn
http://www.sraarchitects.biz
7 REPLIES 7
poco2013
Mentor
IFS ( {Property:Beam/Length Left} <= 8 ', 8 ',
{Property:Beam/Length Left} >= 8'-1", 10 ',
{Property:Beam/Length Left} >= 10'-1", 12 ',
{Property:Beam/Length Left} >= 12'-1", 14 ',
{Property:Beam/Length Left} >= 14'-1", 16 ',
{Property:Beam/Length Left} >= 16'-1", 18 ',
{Property:Beam/Length Left} >= 18'-1", 20 ' )

Too many parenthesis , also last value in ifs is always true
See help in "What's this"
Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27
Red
Advocate
The issue that I am running into is with this setup, once I get past 10'-0", everything gets set as a 10'. Because technically everything is greater than 10'-1" past that mark unless I can set a range for each, pcs of lumber. I think it needs:

{Property:Beam/Length Left} >= 10'-1" OR {Property:Beam/Length Left} <= 11'-11", 12 '

However, I am formatting it wrong...

In what I posted earlier, I forgot to remove the extra parenthesis at the end, I was using several data conversion in another expression when I copied it.
Thanks,
Red
i7 8700k
ROG Strix Z390-E MoBo
64gb RAM
EVGA GeForce GTX 2080
_______________________
http://www.facebook.com/flatcreekdesignstn
http://www.sraarchitects.biz
Red
Advocate
B001 is 8'-0" long and shows correctly at 8
B002 is 8'-1" long and shows correctly at 10
B003 is 10'-1" long and shows incorrectly at 10

Thanks,
Red
i7 8700k
ROG Strix Z390-E MoBo
64gb RAM
EVGA GeForce GTX 2080
_______________________
http://www.facebook.com/flatcreekdesignstn
http://www.sraarchitects.biz
DGSketcher
Legend
Rather than all the IFs try looking at it as a maths problem, see if this offers a better solution...

https://help.graphisoft.com/AC/24/INT/#t=_AC24_Help%2F045_PropertiesClassifications%2F045_Properties...
Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)
Red
Advocate
The lightbulb in my head is slowly warming up....
Thanks,
Red
i7 8700k
ROG Strix Z390-E MoBo
64gb RAM
EVGA GeForce GTX 2080
_______________________
http://www.facebook.com/flatcreekdesignstn
http://www.sraarchitects.biz
Red
Advocate
STR ( STRTONUM ( STRCALCUNIT ( MROUNDUP ( {Property:Beam/Length Left}, 24 " ) ) ), 0 )
Thanks,
Red
i7 8700k
ROG Strix Z390-E MoBo
64gb RAM
EVGA GeForce GTX 2080
_______________________
http://www.facebook.com/flatcreekdesignstn
http://www.sraarchitects.biz
Red
Advocate
Autotext label with the formula...
Thanks,
Red
i7 8700k
ROG Strix Z390-E MoBo
64gb RAM
EVGA GeForce GTX 2080
_______________________
http://www.facebook.com/flatcreekdesignstn
http://www.sraarchitects.biz