<?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 Array with numeric value in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/Array-with-numeric-value/m-p/254214#M7054</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;Hi,&lt;BR /&gt;
&lt;BR /&gt;
i'm trying to make my first gdl script for a rainwater tank in Archicad. I'm able to change the text in the object after people select a predefined value but I also want to change the size of the object according with the tank size.&lt;BR /&gt;
&lt;BR /&gt;
I defined an array but when i try to adjust the size I get the following error: Numeric type expression required at line 77 in the 2D script of file ....&lt;BR /&gt;
&lt;BR /&gt;
I tried deleting the quotes but then there's an error in the array. I tried the ABS() function, but that didn't work either. I also searched the GDL reference guide but couldn't find anything.&lt;BR /&gt;
&lt;BR /&gt;
Can you guys please take a look at my code?&lt;BR /&gt;
Thanks in advance!&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;!
!   Name     : 17.71 regenwaterput.gsm
!   Date     : dinsdag 3 januari 2017
!   Version  : 1.00
!   Written by GJS 
!

mul2	A/2.150000, B/2.150000

DIM typePut[][]

	typePut[1500][1] = "1500"	!inhoud
	typePut[1500][2] = "-.75"	!straal

	typePut[2000][1] = "2000"	!inhoud
	typePut[2000][2] = "-.75"	!straal

	typePut[3000][1] = "3000"	!inhoud
	typePut[3000][2] = "-.875"	!straal

	typePut[5000][1] = "5000"	!inhoud
	typePut[5000][2] = "-1.075"	!straal

	typePut[7000][1] = "7000"	!inhoud
	typePut[7000][2] = "-1.225"	!straal

	typePut[10000][1] = "10 000"	!inhoud
	typePut[10000][2] = "-1.500"		!straal

	typePut[15000][1] = "15 000"	!inhoud
	typePut[15000][2] = "-1.500"		!straal

	typePut[20000][1] = "20 000"	!inhoud
	typePut[15000][2] = "-1.725"		!straal

DEFINE STYLE "tekstVetMiddel" "Arial Narrow Bold", 2.5,1,0
DEFINE STYLE "tekstKlein" "Arial Narrow", 1.5,1,0

Volume = typePut[putVolume][1]

PARAGRAPH "putTekstPara" 2,
	0, 
	0, 
	0, 
	1.15,
	0
	PEN 2
	STYLE "tekstVetMiddel"
 	"Regenwaterput ("+ Volume +" liter)\n"
	STYLE "tekstKlein"
 	"volgens verordening hemelwater"
ENDPARAGRAPH

TEXTBLOCK "putTekst" 0, 
	5, 	!anchor
	0,	!angle
	1,	!width_factor
	1,	!charspace_factor
	1,	!fixed_height 1=mm, 0=m
  "putTekstPara"

RICHTEXT2 0,0, "putTekst"

straal = typePut[putVolume][2]

fill putFill	
poly2_b{5}       9,      3,      1,      3, putSolid, putEmpty, 
                   0,            0,            1,            0,            0,            1,            0, 
              straal, -4.440892098501E-16,     33, 
        1.110223024625E-16, -5.551115123126E-16,    900, 
                   0,          -90,   4033, 
        1.110223024625E-16, -3.330669073875E-16,    900, 
                   0,          -90,   4033, 
        -2.22044604925E-16,            0,    900, 
                   0,          -90,   4033, 
        -1.110223024625E-16, -2.22044604925E-16,    900, 
                   0,          -90,   4033
&lt;/PRE&gt;&lt;/R&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 09 Jan 2017 16:25:00 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-01-09T16:25:00Z</dc:date>
    <item>
      <title>Array with numeric value</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Array-with-numeric-value/m-p/254214#M7054</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;Hi,&lt;BR /&gt;
&lt;BR /&gt;
i'm trying to make my first gdl script for a rainwater tank in Archicad. I'm able to change the text in the object after people select a predefined value but I also want to change the size of the object according with the tank size.&lt;BR /&gt;
&lt;BR /&gt;
I defined an array but when i try to adjust the size I get the following error: Numeric type expression required at line 77 in the 2D script of file ....&lt;BR /&gt;
&lt;BR /&gt;
I tried deleting the quotes but then there's an error in the array. I tried the ABS() function, but that didn't work either. I also searched the GDL reference guide but couldn't find anything.&lt;BR /&gt;
&lt;BR /&gt;
Can you guys please take a look at my code?&lt;BR /&gt;
Thanks in advance!&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;!
!   Name     : 17.71 regenwaterput.gsm
!   Date     : dinsdag 3 januari 2017
!   Version  : 1.00
!   Written by GJS 
!

mul2	A/2.150000, B/2.150000

DIM typePut[][]

	typePut[1500][1] = "1500"	!inhoud
	typePut[1500][2] = "-.75"	!straal

	typePut[2000][1] = "2000"	!inhoud
	typePut[2000][2] = "-.75"	!straal

	typePut[3000][1] = "3000"	!inhoud
	typePut[3000][2] = "-.875"	!straal

	typePut[5000][1] = "5000"	!inhoud
	typePut[5000][2] = "-1.075"	!straal

	typePut[7000][1] = "7000"	!inhoud
	typePut[7000][2] = "-1.225"	!straal

	typePut[10000][1] = "10 000"	!inhoud
	typePut[10000][2] = "-1.500"		!straal

	typePut[15000][1] = "15 000"	!inhoud
	typePut[15000][2] = "-1.500"		!straal

	typePut[20000][1] = "20 000"	!inhoud
	typePut[15000][2] = "-1.725"		!straal

DEFINE STYLE "tekstVetMiddel" "Arial Narrow Bold", 2.5,1,0
DEFINE STYLE "tekstKlein" "Arial Narrow", 1.5,1,0

Volume = typePut[putVolume][1]

PARAGRAPH "putTekstPara" 2,
	0, 
	0, 
	0, 
	1.15,
	0
	PEN 2
	STYLE "tekstVetMiddel"
 	"Regenwaterput ("+ Volume +" liter)\n"
	STYLE "tekstKlein"
 	"volgens verordening hemelwater"
ENDPARAGRAPH

TEXTBLOCK "putTekst" 0, 
	5, 	!anchor
	0,	!angle
	1,	!width_factor
	1,	!charspace_factor
	1,	!fixed_height 1=mm, 0=m
  "putTekstPara"

RICHTEXT2 0,0, "putTekst"

straal = typePut[putVolume][2]

fill putFill	
poly2_b{5}       9,      3,      1,      3, putSolid, putEmpty, 
                   0,            0,            1,            0,            0,            1,            0, 
              straal, -4.440892098501E-16,     33, 
        1.110223024625E-16, -5.551115123126E-16,    900, 
                   0,          -90,   4033, 
        1.110223024625E-16, -3.330669073875E-16,    900, 
                   0,          -90,   4033, 
        -2.22044604925E-16,            0,    900, 
                   0,          -90,   4033, 
        -1.110223024625E-16, -2.22044604925E-16,    900, 
                   0,          -90,   4033
&lt;/PRE&gt;&lt;/R&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 09 Jan 2017 16:25:00 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Array-with-numeric-value/m-p/254214#M7054</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-01-09T16:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: Array with numeric value</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Array-with-numeric-value/m-p/254215#M7055</link>
      <description>Hi, &lt;BR /&gt;
&lt;BR /&gt;
remove &lt;BR /&gt;
mul2   A/2.150000, B/2.150000&lt;BR /&gt;
this scales the object when you change the width and height&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
The putvolume parameter needs to be a number greater than 1, as arrays start at 1 in GDL, a values list in parameter script or master script can solve this...&lt;BR /&gt;
VALUES "parameter_name" [,]value_definition1 [, value_definition2, ...]&lt;BR /&gt;
i.e. values "putVolume" 1500,2000,3000,5000,7000,10000,15000,20000&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
straal needs to be a number, not text (as you can't use text for the poly2_b{5} command)&lt;BR /&gt;
define the numbers without Quotes&lt;BR /&gt;
i.e. &lt;BR /&gt;
   typePut[2000][1] = 2000   !inhoud&lt;BR /&gt;
   typePut[2000][2] = -0.75   !straal&lt;BR /&gt;
(no gaps in the numbers or it will error, 20 000 does not work)&lt;BR /&gt;
&lt;BR /&gt;
STR (numeric_expression, length, fractions)&lt;BR /&gt;
this will convert numbers to text for use in the paragraph (length is actually minimum length of text)&lt;BR /&gt;
i.e. Volume = str(typePut[putVolume][1] ,1,0)&lt;BR /&gt;
&lt;BR /&gt;
or if you want to keep your system formatting &lt;BR /&gt;
STR (format_string, numeric_expression)&lt;BR /&gt;
i.e.Volume = str("%#.0",typePut[putVolume][1])&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
get rid of the exponent numbers and change them to 0...to have the center of the circle an atoms width off center annoys me...&lt;BR /&gt;
&lt;BR /&gt;
poly2_b{5}       9,      3,      1,      3, putSolid, putEmpty,&lt;BR /&gt;
                   0,            0,            1,            0,            0,            1,            0,&lt;BR /&gt;
              straal, 0,     33,&lt;BR /&gt;
				0, 			0,    900,&lt;BR /&gt;
				0,          -90,   4033,&lt;BR /&gt;
				0, 			0,    900,&lt;BR /&gt;
				0,          -90,   4033,&lt;BR /&gt;
				0,            0,    900,&lt;BR /&gt;
				0,          -90,   4033,&lt;BR /&gt;
				0, 			0,    900,&lt;BR /&gt;
				0,          -90,   4033 &lt;BR /&gt;
&lt;BR /&gt;
if you still have errors...then try&lt;BR /&gt;
when you make the parameters in the parameters list &lt;BR /&gt;
putfill needs to be a Fill type &lt;BR /&gt;
putSolid needs to be a Pen Type&lt;BR /&gt;
putEmpty needs to be a Pen Type&lt;BR /&gt;
putVolume needs to be a Real number or Interger type, as the actual number for length is based on meters and the displayed number may be mm or another unit. this would mean you have a much larger number i.e.1500000 for the smallest tank.&lt;BR /&gt;
or just asign intergers &lt;BR /&gt;
for putSolid pen 1 to 255&lt;BR /&gt;
for  putEmpty pen -1 to 255&lt;BR /&gt;
for putfill 65(background or empty fill) or 64(solid or foreground fill)&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
i hope this helps&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
in parameter script&lt;BR /&gt;
values "putVolume" 1500,2000,3000,5000,7000,10000,15000,20000&lt;BR /&gt;
&lt;BR /&gt;
in 2d script&lt;BR /&gt;
DIM typePut[][]&lt;BR /&gt;
&lt;BR /&gt;
   typePut[1500][1] = 1500   !inhoud&lt;BR /&gt;
   typePut[1500][2] = -0.75   !straal&lt;BR /&gt;
&lt;BR /&gt;
   typePut[2000][1] = 2000   !inhoud&lt;BR /&gt;
   typePut[2000][2] = -0.75   !straal&lt;BR /&gt;
&lt;BR /&gt;
   typePut[3000][1] = 3000   !inhoud&lt;BR /&gt;
   typePut[3000][2] = -0.875   !straal&lt;BR /&gt;
&lt;BR /&gt;
   typePut[5000][1] = 5000   !inhoud&lt;BR /&gt;
   typePut[5000][2] = -1.075   !straal&lt;BR /&gt;
&lt;BR /&gt;
   typePut[7000][1] = 7000   !inhoud&lt;BR /&gt;
   typePut[7000][2] = -1.225   !straal&lt;BR /&gt;
&lt;BR /&gt;
   typePut[10000][1] = 10000   !inhoud&lt;BR /&gt;
   typePut[10000][2] = -1.500     !straal&lt;BR /&gt;
&lt;BR /&gt;
   typePut[15000][1] = 15000   !inhoud&lt;BR /&gt;
   typePut[15000][2] = -1.500      !straal&lt;BR /&gt;
&lt;BR /&gt;
   typePut[20000][1] = 20000   !inhoud&lt;BR /&gt;
   typePut[20000][2] = -1.725      !straal&lt;BR /&gt;
&lt;BR /&gt;
DEFINE STYLE "tekstVetMiddel" "Arial Narrow Bold", 2.5,1,0&lt;BR /&gt;
DEFINE STYLE "tekstKlein" "Arial Narrow", 1.5,1,0&lt;BR /&gt;
Volume = str("%#.0",typePut[putVolume][1])&lt;BR /&gt;
&lt;BR /&gt;
PARAGRAPH "putTekstPara" 2,&lt;BR /&gt;
   0,&lt;BR /&gt;
   0,&lt;BR /&gt;
   0,&lt;BR /&gt;
   1.15,&lt;BR /&gt;
   0&lt;BR /&gt;
   PEN 2&lt;BR /&gt;
   STYLE "tekstVetMiddel"&lt;BR /&gt;
    "Regenwaterput ("+ Volume +" liter)\n"&lt;BR /&gt;
   STYLE "tekstKlein"&lt;BR /&gt;
    "volgens verordening hemelwater"&lt;BR /&gt;
ENDPARAGRAPH&lt;BR /&gt;
&lt;BR /&gt;
TEXTBLOCK "putTekst" 0,&lt;BR /&gt;
   5,    !anchor&lt;BR /&gt;
   0,   !angle&lt;BR /&gt;
   1,   !width_factor&lt;BR /&gt;
   1,   !charspace_factor&lt;BR /&gt;
   1,   !fixed_height 1=mm, 0=m&lt;BR /&gt;
  "putTekstPara"&lt;BR /&gt;
&lt;BR /&gt;
RICHTEXT2 0,0, "putTekst"&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
!!!!!!!!!!!!!!!!!!!!!!!Needs to be a number&lt;BR /&gt;
straal = typePut[putVolume][2]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
fill putFill   &lt;BR /&gt;
poly2_b{5}       9,      3,      1,      3, putSolid, putEmpty,&lt;BR /&gt;
                   0,            0,            1,            0,            0,            1,            0,&lt;BR /&gt;
				straal,	0,		33,&lt;BR /&gt;
				0,		0,		900,&lt;BR /&gt;
				0,		-90,	4033,&lt;BR /&gt;
				0,		0,		900,&lt;BR /&gt;
				0,		-90,	4033,&lt;BR /&gt;
				0,		0,		900,&lt;BR /&gt;
				0,		-90,   	4033,&lt;BR /&gt;
				0,		0,    	900,&lt;BR /&gt;
				0,		-90,   	4033</description>
      <pubDate>Sun, 22 Jan 2017 23:55:26 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Array-with-numeric-value/m-p/254215#M7055</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-01-22T23:55:26Z</dc:date>
    </item>
  </channel>
</rss>

