<?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: Tutorial for PUT&amp;amp;GET? in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/Tutorial-for-PUT-amp-GET/m-p/245913#M4131</link>
    <description>What sort of function are you applying it to? Is it 3D or 2D geometry and if so what type of shape?&lt;BR /&gt;
Polygons, Extrudes, Revolves are all easy because each line has the same number of values (usually 3; x, y, status) therefore when setting the number of nodes its "nsp/3".&lt;BR /&gt;
However Tubes are more complex because they can have 3 values for the profile and 4 values for the path. therefore you can't divide the NSP (stored values) to get the node count. So in this case I follow each line with a counter like this (pay attention to the cntNSP_1 &amp;amp; cntNSP_2) :&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;cntNSP_1 = 0
cntNSP_2 = 0
for m = 1 to vardim1(_nodes_OESF_L)
	put -_nodes_OESF_L&lt;M&gt;[xNde], _nodes_OESF_L&lt;M&gt;[yNde], 0:	cntNSP_1 = cntNSP_1 +1
next m

put 0, 	StartY -.001, 0, 0:		cntNSP_2 = cntNSP_2 +1
put 0, 	StartY, 0, 0:			cntNSP_2 = cntNSP_2 +1
put 0, 	hOEsubFRAME, 0, 0:		cntNSP_2 = cntNSP_2 +1
put 0, 	hOEsubFRAME +.001, 0, 0:	cntNSP_2 = cntNSP_2 +1
tube cntNSP_1, cntNSP_2, 1+2+16+32,
	get(nsp)
&lt;/M&gt;&lt;/M&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 22 Feb 2021 21:16:59 GMT</pubDate>
    <dc:creator>Kristian Bursell</dc:creator>
    <dc:date>2021-02-22T21:16:59Z</dc:date>
    <item>
      <title>Tutorial for PUT&amp;GET?</title>
      <link>https://community.graphisoft.com/t5/GDL/Tutorial-for-PUT-amp-GET/m-p/245906#M4124</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hi,&lt;BR /&gt;I've been looking for examples but haven't found any except for the manual. Any basic youtube (or other) tutorials someone know?&lt;BR /&gt;/Mats&lt;/DIV&gt;</description>
      <pubDate>Tue, 14 Sep 2021 11:23:04 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Tutorial-for-PUT-amp-GET/m-p/245906#M4124</guid>
      <dc:creator>Mats_Knutsson</dc:creator>
      <dc:date>2021-09-14T11:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: Tutorial for PUT&amp;GET?</title>
      <link>https://community.graphisoft.com/t5/GDL/Tutorial-for-PUT-amp-GET/m-p/245907#M4125</link>
      <description>There is a tube sample object from GS somewhere that uses it. I attached it in &lt;A href="https://archicad-talk.graphisoft.com/viewtopic.php?f=20&amp;amp;t=66951&amp;amp;p=297888&amp;amp;hilit=tube#p297888" target="_blank"&gt;this&lt;/A&gt; thread. Not sure where the original post is.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ling.</description>
      <pubDate>Mon, 22 Feb 2021 09:06:33 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Tutorial-for-PUT-amp-GET/m-p/245907#M4125</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2021-02-22T09:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: Tutorial for PUT&amp;GET?</title>
      <link>https://community.graphisoft.com/t5/GDL/Tutorial-for-PUT-amp-GET/m-p/245908#M4126</link>
      <description>Here is an example that I have made to obtain a polygon with desired number of edges:&lt;BR /&gt;
&lt;BR /&gt;
3D Script:&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;
!below, n represents the number of the edges. eEach stands for the angle between the lines
!that start from the centre and goes to the corners.

aEach = 360/n 

!The loop is to store the coordinates of the corner points. The centre of the polygon is at
! 0,0. Each time the loop is executed, the "PUT" command stores another corner 

for aTurn = 0 to 360 step aEach 
PUT	dCentreToCorner*cos(aTurn),  dCentreToCorner*sin(aTurn)

next aTurn

!Now all the stored data is going to be used in a PRISM command. Rather any parameters, the coordinates
!of the points come from the data stored.

PRISM n+1, ZZYZX,
get (nsp)&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Feb 2021 09:14:40 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Tutorial-for-PUT-amp-GET/m-p/245908#M4126</guid>
      <dc:creator>Goker Altuntas</dc:creator>
      <dc:date>2021-02-22T09:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: Tutorial for PUT&amp;GET?</title>
      <link>https://community.graphisoft.com/t5/GDL/Tutorial-for-PUT-amp-GET/m-p/245909#M4127</link>
      <description>Do a search for GDL Cookbook 3 by David Nicholson-Cole. His book is a fantastic tutorial from beginner to advanced and in the later chapters he explains just how important Put &amp;amp; Get are to efficient GDL programming. It is getting a bit old now but the basics are still relevant, I think because of that you can find it in the public domain and there is I believe a web based version. Alternatively you could pay back his generous contribution to teaching GDL and buy a copy.</description>
      <pubDate>Mon, 22 Feb 2021 09:26:45 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Tutorial-for-PUT-amp-GET/m-p/245909#M4127</guid>
      <dc:creator>DGSketcher</dc:creator>
      <dc:date>2021-02-22T09:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: Tutorial for PUT&amp;GET?</title>
      <link>https://community.graphisoft.com/t5/GDL/Tutorial-for-PUT-amp-GET/m-p/245910#M4128</link>
      <description>I have the cookbook. Was looking for more examples like Gokers &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_smile.gif" style="display : inline;" /&gt;.</description>
      <pubDate>Mon, 22 Feb 2021 12:21:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Tutorial-for-PUT-amp-GET/m-p/245910#M4128</guid>
      <dc:creator>Mats_Knutsson</dc:creator>
      <dc:date>2021-02-22T12:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: Tutorial for PUT&amp;GET?</title>
      <link>https://community.graphisoft.com/t5/GDL/Tutorial-for-PUT-amp-GET/m-p/245911#M4129</link>
      <description>here is not the best example of my &lt;A href="https://archicad-talk.graphisoft.com/viewtopic.php?p=320103#p320103" target="_blank"&gt;post&lt;/A&gt; with put/get and &lt;A href="https://archicad-talk.graphisoft.com/viewtopic.php?p=320195#p320195" target="_blank"&gt;here &lt;/A&gt;&lt;A href="https://archicad-talk.graphisoft.com/memberlist.php?mode=viewprofile&amp;amp;u=76711" target="_blank"&gt;Kristian Bursell&lt;/A&gt; explain how to use it wiser&lt;BR /&gt;
&lt;BR /&gt;
and &lt;A href="https://archicad-talk.graphisoft.com/viewtopic.php?p=322457#p322457" target="_blank"&gt;here&lt;/A&gt; &lt;A href="https://archicad-talk.graphisoft.com/memberlist.php?mode=viewprofile&amp;amp;u=107013" target="_blank"&gt;Peter Baksa&lt;/A&gt; has code with put/use</description>
      <pubDate>Mon, 22 Feb 2021 13:30:05 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Tutorial-for-PUT-amp-GET/m-p/245911#M4129</guid>
      <dc:creator>A_ Smith</dc:creator>
      <dc:date>2021-02-22T13:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: Tutorial for PUT&amp;GET?</title>
      <link>https://community.graphisoft.com/t5/GDL/Tutorial-for-PUT-amp-GET/m-p/245912#M4130</link>
      <description>&lt;BLOCKQUOTE&gt;A. wrote:&lt;BR /&gt;
here is not the best example of my &lt;A href="https://archicad-talk.graphisoft.com/viewtopic.php?p=320103#p320103" target="_blank"&gt;post&lt;/A&gt; with put/get and &lt;A href="https://archicad-talk.graphisoft.com/viewtopic.php?p=320195#p320195" target="_blank"&gt;here &lt;/A&gt;&lt;A href="https://archicad-talk.graphisoft.com/memberlist.php?mode=viewprofile&amp;amp;u=76711" target="_blank"&gt;Kristian Bursell&lt;/A&gt; explain how to use it wiser&lt;BR /&gt;
&lt;BR /&gt;
and &lt;A href="https://archicad-talk.graphisoft.com/viewtopic.php?p=322457#p322457" target="_blank"&gt;here&lt;/A&gt; &lt;A href="https://archicad-talk.graphisoft.com/memberlist.php?mode=viewprofile&amp;amp;u=107013" target="_blank"&gt;Peter Baksa&lt;/A&gt; has code with put/use
&lt;/BLOCKQUOTE&gt;

Great! Thx.</description>
      <pubDate>Mon, 22 Feb 2021 13:35:19 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Tutorial-for-PUT-amp-GET/m-p/245912#M4130</guid>
      <dc:creator>Mats_Knutsson</dc:creator>
      <dc:date>2021-02-22T13:35:19Z</dc:date>
    </item>
    <item>
      <title>Re: Tutorial for PUT&amp;GET?</title>
      <link>https://community.graphisoft.com/t5/GDL/Tutorial-for-PUT-amp-GET/m-p/245913#M4131</link>
      <description>What sort of function are you applying it to? Is it 3D or 2D geometry and if so what type of shape?&lt;BR /&gt;
Polygons, Extrudes, Revolves are all easy because each line has the same number of values (usually 3; x, y, status) therefore when setting the number of nodes its "nsp/3".&lt;BR /&gt;
However Tubes are more complex because they can have 3 values for the profile and 4 values for the path. therefore you can't divide the NSP (stored values) to get the node count. So in this case I follow each line with a counter like this (pay attention to the cntNSP_1 &amp;amp; cntNSP_2) :&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;cntNSP_1 = 0
cntNSP_2 = 0
for m = 1 to vardim1(_nodes_OESF_L)
	put -_nodes_OESF_L&lt;M&gt;[xNde], _nodes_OESF_L&lt;M&gt;[yNde], 0:	cntNSP_1 = cntNSP_1 +1
next m

put 0, 	StartY -.001, 0, 0:		cntNSP_2 = cntNSP_2 +1
put 0, 	StartY, 0, 0:			cntNSP_2 = cntNSP_2 +1
put 0, 	hOEsubFRAME, 0, 0:		cntNSP_2 = cntNSP_2 +1
put 0, 	hOEsubFRAME +.001, 0, 0:	cntNSP_2 = cntNSP_2 +1
tube cntNSP_1, cntNSP_2, 1+2+16+32,
	get(nsp)
&lt;/M&gt;&lt;/M&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Feb 2021 21:16:59 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Tutorial-for-PUT-amp-GET/m-p/245913#M4131</guid>
      <dc:creator>Kristian Bursell</dc:creator>
      <dc:date>2021-02-22T21:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: Tutorial for PUT&amp;GET?</title>
      <link>https://community.graphisoft.com/t5/GDL/Tutorial-for-PUT-amp-GET/m-p/245914#M4132</link>
      <description>&lt;BLOCKQUOTE&gt;Kristian wrote:&lt;BR /&gt;
What sort of function are you applying it to? Is it 3D or 2D geometry and if so what type of shape?&lt;BR /&gt;
Polygons, Extrudes, Revolves are all easy because each line has the same number of values (usually 3; x, y, status) therefore when setting the number of nodes its "nsp/3".&lt;BR /&gt;
However Tubes are more complex because they can have 3 values for the profile and 4 values for the path. therefore you can't divide the NSP (stored values) to get the node count. So in this case I follow each line with a counter like this (pay attention to the cntNSP_1 &amp;amp; cntNSP_2) :&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;cntNSP_1 = 0
cntNSP_2 = 0
for m = 1 to vardim1(_nodes_OESF_L)
	put -_nodes_OESF_L&lt;M&gt;[xNde], _nodes_OESF_L&lt;M&gt;[yNde], 0:	cntNSP_1 = cntNSP_1 +1
next m

put 0, 	StartY -.001, 0, 0:		cntNSP_2 = cntNSP_2 +1
put 0, 	StartY, 0, 0:			cntNSP_2 = cntNSP_2 +1
put 0, 	hOEsubFRAME, 0, 0:		cntNSP_2 = cntNSP_2 +1
put 0, 	hOEsubFRAME +.001, 0, 0:	cntNSP_2 = cntNSP_2 +1
tube cntNSP_1, cntNSP_2, 1+2+16+32,
	get(nsp)
&lt;/M&gt;&lt;/M&gt;&lt;/PRE&gt;
&lt;/BLOCKQUOTE&gt;

Thanks! I'll dig into this. Just need a couple of hours of spare time.The original reason was that I wanted to add HEX colour values somewhere. Since I spent a week skiing with ny brother in law (IT-guy) we discussed some IT-related stuff and when he was explaining Json I imagined I could store whatever in Archicad the same way.&lt;BR /&gt;
&lt;BR /&gt;
Back to adding materials to the BM-catalogue...</description>
      <pubDate>Tue, 23 Feb 2021 07:34:37 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Tutorial-for-PUT-amp-GET/m-p/245914#M4132</guid>
      <dc:creator>Mats_Knutsson</dc:creator>
      <dc:date>2021-02-23T07:34:37Z</dc:date>
    </item>
  </channel>
</rss>

