<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: help with zone object in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/help-with-zone-object/m-p/166513#M20543</link>
    <description>jkershaw:&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
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:&lt;BR /&gt;

&lt;PRE&gt;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 
ENDIF &lt;/PRE&gt;

Where &lt;FONT color="blue"&gt;"%n%s%n"&lt;/FONT&gt; is picking up the comma between the thousands and hundreds. This is rough, there may be further refinements depending on your desired result.&lt;BR /&gt;
&lt;BR /&gt;
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.&lt;BR /&gt;
&lt;BR /&gt;
David</description>
    <pubDate>Mon, 05 Jul 2010 15:08:10 GMT</pubDate>
    <dc:creator>David Maudlin</dc:creator>
    <dc:date>2010-07-05T15:08:10Z</dc:date>
    <item>
      <title>help with zone object</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/help-with-zone-object/m-p/166511#M20541</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;Ok, please forgive my newbie-ness.&lt;BR /&gt;
&lt;BR /&gt;
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.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
here's the code:&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;! ====== Place Occupant Text ===================&lt;BR /&gt;
	IF showLoad THEN&lt;BR /&gt;
		rrr=REQUEST ("Area_dimension","",area_form)&lt;BR /&gt;
		 room_area = STR (area_form, ROOM_AREA)&lt;BR /&gt;
		net_area_val = ""&lt;BR /&gt;
		n = SPLIT(ROOM_AREA,"%n",net_area_val)&lt;BR /&gt;
		occLoad = STR (CEIL(net_area_val/SqFtPerson),1,0)&lt;BR /&gt;
&lt;BR /&gt;
		TEXT2 0,-vOffset, "Occupant Load: " + occLoad&lt;BR /&gt;
		HOTSPOT2 0,-(vOffset)-(strHt2/2)&lt;BR /&gt;
		vOffset=vOffset+strHt2&lt;BR /&gt;
	ENDIF&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
I suspect it's something in the SPLIT command, but quite frankly, I'm lost. Any help would be greatly appreciated!&lt;/R&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;IMG src="http://community.graphisoft.com/t5/image/serverpage/image-id/71452iFB8A44A5F2BD7A19/image-size/large?v=v2&amp;amp;px=999" border="0" alt="Picture 6.png" title="Picture 6.png" /&gt;</description>
      <pubDate>Thu, 01 Jul 2010 22:54:10 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/help-with-zone-object/m-p/166511#M20541</guid>
      <dc:creator>jkershaw</dc:creator>
      <dc:date>2010-07-01T22:54:10Z</dc:date>
    </item>
    <item>
      <title>Re: help with zone object</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/help-with-zone-object/m-p/166512#M20542</link>
      <description>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.&lt;BR /&gt;
You can check this: maybe beyond 2000, the result will be 2.&lt;BR /&gt;
You should use string operations to strip the comma out of the string and then do the calculation.</description>
      <pubDate>Fri, 02 Jul 2010 21:44:58 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/help-with-zone-object/m-p/166512#M20542</guid>
      <dc:creator>Laszlo Nagy</dc:creator>
      <dc:date>2010-07-02T21:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: help with zone object</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/help-with-zone-object/m-p/166513#M20543</link>
      <description>jkershaw:&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
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:&lt;BR /&gt;

&lt;PRE&gt;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 
ENDIF &lt;/PRE&gt;

Where &lt;FONT color="blue"&gt;"%n%s%n"&lt;/FONT&gt; is picking up the comma between the thousands and hundreds. This is rough, there may be further refinements depending on your desired result.&lt;BR /&gt;
&lt;BR /&gt;
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.&lt;BR /&gt;
&lt;BR /&gt;
David</description>
      <pubDate>Mon, 05 Jul 2010 15:08:10 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/help-with-zone-object/m-p/166513#M20543</guid>
      <dc:creator>David Maudlin</dc:creator>
      <dc:date>2010-07-05T15:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: help with zone object</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/help-with-zone-object/m-p/166514#M20544</link>
      <description>Laszlo and David -&lt;BR /&gt;
&lt;BR /&gt;
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!</description>
      <pubDate>Tue, 06 Jul 2010 15:01:21 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/help-with-zone-object/m-p/166514#M20544</guid>
      <dc:creator>jkershaw</dc:creator>
      <dc:date>2010-07-06T15:01:21Z</dc:date>
    </item>
  </channel>
</rss>

