help with zone object
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2010-07-02 12:54 AM
ā2010-07-02
12:54 AM
I'm attempting to modify an existing zone stamp so that it can actively calculate an occupant load based on the room area and the occupant load factor. It works great until the room gets to be over 1000 SF. Please see image below.
here's the code:
! ====== Place Occupant Text ===================
IF showLoad THEN
rrr=REQUEST ("Area_dimension","",area_form)
room_area = STR (area_form, ROOM_AREA)
net_area_val = ""
n = SPLIT(ROOM_AREA,"%n",net_area_val)
occLoad = STR (CEIL(net_area_val/SqFtPerson),1,0)
TEXT2 0,-vOffset, "Occupant Load: " + occLoad
HOTSPOT2 0,-(vOffset)-(strHt2/2)
vOffset=vOffset+strHt2
ENDIF
I suspect it's something in the SPLIT command, but quite frankly, I'm lost. Any help would be greatly appreciated!
AC26 APPLE SILICON USA FULL 4032
Mac Studio 2022, Apple M1 Max, 64GB RAM
13.2 macOS Ventura
learning AC since version 4.5
Mac Studio 2022, Apple M1 Max, 64GB RAM
13.2 macOS Ventura
learning AC since version 4.5
3 REPLIES 3

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2010-07-02 11:44 PM
ā2010-07-02
11:44 PM
Maybe it has something to do with the comma at the thousand place. It cannot deal with it because a comma is not a number so it takes the '1' at the beginning of the string.
You can check this: maybe beyond 2000, the result will be 2.
You should use string operations to strip the comma out of the string and then do the calculation.
You can check this: maybe beyond 2000, the result will be 2.
You should use string operations to strip the comma out of the string and then do the calculation.
Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac28
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac28

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2010-07-05 05:08 PM
ā2010-07-05
05:08 PM
jkershaw:
Laszlo is on the right track. The square footage is being returned as a text string, not a number, so the comma will split the string when present when the square footage equals or exceeds 1,000. So you can try:
You should add a Signature to your Profile (click the Profile button near the top of this page) with your ArchiCAD version and operating system (see mine for an example) for more accurate help in this forum.
David
Laszlo is on the right track. The square footage is being returned as a text string, not a number, so the comma will split the string when present when the square footage equals or exceeds 1,000. So you can try:
IF showLoad THEN rrr=REQUEST ("Area_dimension","",area_form) room_area = STR (area_form, ROOM_AREA) net_area_val = "" n = SPLIT(ROOM_AREA, "%n%s%n", net_area_val2, comma, net_area_val1) ! n = SPLIT(ROOM_AREA,"%n",net_area_val) net_area_val = net_area_val2 + net_area_val1 occLoad = STR (CEIL(net_area_val/SqFtPerson),1,0) TEXT2 0,-vOffset, "Occupant Load: " + occLoad HOTSPOT2 0,-(vOffset)-(strHt2/2) vOffset=vOffset+strHt2 ENDIFWhere "%n%s%n" is picking up the comma between the thousands and hundreds. This is rough, there may be further refinements depending on your desired result.
You should add a Signature to your Profile (click the Profile button near the top of this page) with your ArchiCAD version and operating system (see mine for an example) for more accurate help in this forum.
David
David Maudlin / Architect
www.davidmaudlin.com
Digital Architecture
AC28 USA ⢠Mac mini M4 Pro OSX15 | 64 gb ram ⢠MacBook Pro M3 Pro | 36 gb ram OSX14
www.davidmaudlin.com
Digital Architecture
AC28 USA ⢠Mac mini M4 Pro OSX15 | 64 gb ram ⢠MacBook Pro M3 Pro | 36 gb ram OSX14
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2010-07-06 05:01 PM
ā2010-07-06
05:01 PM
Laszlo and David -
Thank you SO much for your replies! That is extremely helpful in understanding how to properly parse the string into the component parts. I will give it a shot!
Thank you SO much for your replies! That is extremely helpful in understanding how to properly parse the string into the component parts. I will give it a shot!
AC26 APPLE SILICON USA FULL 4032
Mac Studio 2022, Apple M1 Max, 64GB RAM
13.2 macOS Ventura
learning AC since version 4.5
Mac Studio 2022, Apple M1 Max, 64GB RAM
13.2 macOS Ventura
learning AC since version 4.5