<?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: Library global array in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/Library-global-array/m-p/594952#M6438</link>
    <description>&lt;P&gt;Please read this topic:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.graphisoft.com/t5/GDL/LIBRARYGLOBAL-vs-2-dimension-array/m-p/252379#M2866" target="_blank"&gt;https://community.graphisoft.com/t5/GDL/LIBRARYGLOBAL-vs-2-dimension-array/m-p/252379#M2866&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Mar 2024 17:05:33 GMT</pubDate>
    <dc:creator>Jochen Suehlo</dc:creator>
    <dc:date>2024-03-13T17:05:33Z</dc:date>
    <item>
      <title>Library global array</title>
      <link>https://community.graphisoft.com/t5/GDL/Library-global-array/m-p/594946#M6437</link>
      <description>&lt;P&gt;HI I have A global object with a parameter xy[16][16]&lt;/P&gt;
&lt;P&gt;Now I want to find the easiest way to get the content of xy[5][6].&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only way I actually get a result is:&lt;/P&gt;
&lt;P&gt;k=LIBRARYGLOBAL ("glob_obj", "xy", cont_1, cont_2, cont_3,...) where&amp;nbsp; cont_1=xy[1][1], cont_2=xy[1][2], cont_3=xy[1][3]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have 16 cloums so i guess i'll need to go until ...,cont_15,cont_16,cont_17) to make cont_17 the field xy[2][1]&amp;nbsp; but I havn't tried that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there no more efficient way to "call" the content of a field?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2024 11:11:22 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Library-global-array/m-p/594946#M6437</guid>
      <dc:creator>kmcw</dc:creator>
      <dc:date>2024-09-26T11:11:22Z</dc:date>
    </item>
    <item>
      <title>Re: Library global array</title>
      <link>https://community.graphisoft.com/t5/GDL/Library-global-array/m-p/594952#M6438</link>
      <description>&lt;P&gt;Please read this topic:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.graphisoft.com/t5/GDL/LIBRARYGLOBAL-vs-2-dimension-array/m-p/252379#M2866" target="_blank"&gt;https://community.graphisoft.com/t5/GDL/LIBRARYGLOBAL-vs-2-dimension-array/m-p/252379#M2866&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 17:05:33 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Library-global-array/m-p/594952#M6438</guid>
      <dc:creator>Jochen Suehlo</dc:creator>
      <dc:date>2024-03-13T17:05:33Z</dc:date>
    </item>
    <item>
      <title>Re: Library global array</title>
      <link>https://community.graphisoft.com/t5/GDL/Library-global-array/m-p/594957#M6439</link>
      <description>&lt;P&gt;sorry, that comunication doesn't help me. They are talking about calling obejects etc...&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 17:42:48 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Library-global-array/m-p/594957#M6439</guid>
      <dc:creator>kmcw</dc:creator>
      <dc:date>2024-03-13T17:42:48Z</dc:date>
    </item>
    <item>
      <title>Re: Library global array</title>
      <link>https://community.graphisoft.com/t5/GDL/Library-global-array/m-p/594962#M6440</link>
      <description>&lt;P&gt;Read carefully then. The concept is the same!&lt;/P&gt;
&lt;P&gt;To quote myself and the GDL manual:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;"Requests (and Libraryglobal is also a request) do not handle two-dimensional arrays."&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;And Kristian shows how to convert it back to a 2D array from a 1D one.&lt;/P&gt;
&lt;P&gt;Only difference: You'll need to now the dimensions yourself, the request doesn't return them.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 18:22:40 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Library-global-array/m-p/594962#M6440</guid>
      <dc:creator>runxel</dc:creator>
      <dc:date>2024-03-13T18:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: Library global array</title>
      <link>https://community.graphisoft.com/t5/GDL/Library-global-array/m-p/595010#M6441</link>
      <description>&lt;P&gt;The entire array has to be read up to the point of the number you wish to get,&lt;/P&gt;
&lt;P&gt;either&lt;/P&gt;
&lt;P&gt;k=LIBRARYGLOBAL ("glob_obj", "xy", cont_1, cont_2, cont_3,...)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or ..................&lt;/P&gt;
&lt;P&gt;use an array function to read all the variables and then reconstruct the array in the new file&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I set the array sizes in the global&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;!!------this bit is just to set some values for this test
for j = 1 to 16
  for ii = 1 to 18
    xy[ii][j] = ii*100+j
  next ii
next j
parameters xy = xy
!!------this bit is just to set some values for this test

!!------this bit measures the size of the array and sets it as variables that can be read
xy_array1 = vardim1(xy)
xy_array2 = vardim2(xy)
parameters xy_array1 = xy_array1
parameters xy_array2 = xy_array2

!!------this bit measures the size of the array and sets it as variables that can be read&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AllanP_6-1710369819043.png" style="width: 746px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/57427i234D7C4CC1BB4D99/image-dimensions/746x237?v=v2" width="746" height="237" role="button" title="AllanP_6-1710369819043.png" alt="AllanP_6-1710369819043.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AllanP_7-1710369834325.png" style="width: 738px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/57428i0AE6F0775A4C6B57/image-dimensions/738x297?v=v2" width="738" height="297" role="button" title="AllanP_7-1710369834325.png" alt="AllanP_7-1710369834325.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AllanP_13-1710371932634.png" style="width: 744px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/57434i9102C0AF40B566BD/image-dimensions/744x467?v=v2" width="744" height="467" role="button" title="AllanP_13-1710371932634.png" alt="AllanP_13-1710371932634.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;then read the array,&lt;/P&gt;
&lt;P&gt;you will see that the new array read will only be a 1 dimensional array&lt;/P&gt;
&lt;P&gt;so a 1x288 rather than a 18x16 as per the original&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;!!!----READ THE ARRAY FROM THE LIBRARY GLOBAL INTO A NEW ARRAY "xy_Temp[][]"----!!
dim xy_Temp[][]

!!!___note you can just do a 1 dimensional array at this point   

!!!"dim xy_Temp[]"
success0 = LIBRARYGLOBAL ("1-test GLOBAL", "xy", xy_Temp)
success1 = LIBRARYGLOBAL ("1-test GLOBAL", "xy_array1", xy_array1)
success2 = LIBRARYGLOBAL ("1-test GLOBAL", "xy_array2", xy_array2)

!!!!if just reading from the array then you could just use
co_ordinate1 = (xy_array2)*(6-1)+5
text2 0,1, vardim1(xy_Temp)
text2 0,2, vardim2(xy_Temp)
text2 0,3,xy_array1
text2 0,4,xy_array2
text2 0,5,xy_Temp[1][co_ordinate1]

!!!----CONVERT 1 DIMENSIONAL ARRAY BACK TO 2 DIMENSIONAL ARRAY----!!
dim xy[][]
for j = 1 to xy_array1
for i = 1 to xy_array2
co_ordinate = (j-1)*xy_array2+i
xy[j][i] = xy_Temp[1][co_ordinate]
next i
next j
text2 0,7,xy[6][5]
parameters xy = xy&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AllanP_10-1710371807307.png" style="width: 805px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/57431i0B31E1D4D5DD421E/image-dimensions/805x477?v=v2" width="805" height="477" role="button" title="AllanP_10-1710371807307.png" alt="AllanP_10-1710371807307.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AllanP_12-1710371884362.png" style="width: 872px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/57433i2BD2FA72BD523216/image-dimensions/872x468?v=v2" width="872" height="468" role="button" title="AllanP_12-1710371884362.png" alt="AllanP_12-1710371884362.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;P.S.&lt;/P&gt;
&lt;P&gt;if you don't want to convert it back to an array you only need :&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;dim xy_Temp[]
success0 = LIBRARYGLOBAL ("1-test GLOBAL", "xy", xy_Temp)
success2 = LIBRARYGLOBAL ("1-test GLOBAL", "xy_array2", xy_array2)
co_ordinate1 = (xy_array2)*(6-1)+5
text2 0,5,xy_Temp[co_ordinate1]&lt;/LI-CODE&gt;
&lt;P&gt;and if the size of the array is always know(it wont change in the future) then you can replace the xy_array2 part with the fixed number.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2024 14:38:59 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Library-global-array/m-p/595010#M6441</guid>
      <dc:creator>AllanP</dc:creator>
      <dc:date>2024-03-15T14:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: Library global array</title>
      <link>https://community.graphisoft.com/t5/GDL/Library-global-array/m-p/599806#M6539</link>
      <description>&lt;P&gt;Thank you very much, I'll try that as soon as I have time.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2024 08:21:10 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Library-global-array/m-p/599806#M6539</guid>
      <dc:creator>kmcw</dc:creator>
      <dc:date>2024-04-18T08:21:10Z</dc:date>
    </item>
  </channel>
</rss>

