<?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: Polygon with variable number of sides in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/Polygon-with-variable-number-of-sides/m-p/162624#M25746</link>
    <description>Of course, you can write pgons under this form &lt;BR /&gt;
&lt;BR /&gt;
if bCond1 then&lt;BR /&gt;
	put 6, 0, 16,  1, 2, 3,  4,  5,  6    ! # 1&lt;BR /&gt;
	put 6, 0, 16,  7, 8, 9, 10, 11, 12    ! # 2&lt;BR /&gt;
else    &lt;BR /&gt;
	put 8, 0, 16,  1,  2,  3,  4,  5,  6,  7,  8    ! # 1&lt;BR /&gt;
	put 8, 0, 16,  9, 10, 11, 12, 13, 14, 15, 16    ! # 2&lt;BR /&gt;
endif&lt;BR /&gt;
&lt;BR /&gt;
for k = 1 to 2&lt;BR /&gt;
	pgon get(nsp/(3-k))&lt;BR /&gt;
next k&lt;BR /&gt;
&lt;BR /&gt;
But ... since you HAVE to declare each pgon, it is easier to write them directly.&lt;BR /&gt;
I don't think put/get statements are of any help for pgons, in general. &lt;BR /&gt;
It would be difficult to deal with buffer polycount.&lt;BR /&gt;
Barry's solution seems more relevant. &lt;BR /&gt;
&lt;BR /&gt;
if bCond1 then&lt;BR /&gt;
	pgon  6, 0, 16,  1, 2, 3,  4,  5,  6    ! # 1 &lt;BR /&gt;
	pgon  6, 0, 16,  7, 8, 9, 10, 11, 12    ! # 2 &lt;BR /&gt;
else    &lt;BR /&gt;
	pgon  8, 0, 16,  1,  2,  3,  4,  5,  6,  7,  8    ! # 1 &lt;BR /&gt;
	pgon  8, 0, 16,  9, 10, 11, 12, 13, 14, 15, 16    ! # 2&lt;BR /&gt;
endif&lt;BR /&gt;
 &lt;BR /&gt;
For a single planar pgon with a variable number of sides, put/get statements can work.&lt;BR /&gt;
There are more simple ways to achieve this. &lt;BR /&gt;
Use primitives only when not any current tool can achieve what you want.</description>
    <pubDate>Wed, 28 Jan 2009 20:42:22 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2009-01-28T20:42:22Z</dc:date>
    <item>
      <title>Polygon with variable number of sides</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Polygon-with-variable-number-of-sides/m-p/162620#M25742</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;hello&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
is it possible to create a polygon with a variable number of sides ?&lt;BR /&gt;
&lt;BR /&gt;
something like this ?&lt;BR /&gt;
&lt;BR /&gt;
PGON   nSide, 0, -1,   &lt;BR /&gt;
           for i to nSide &lt;BR /&gt;
             i,&lt;BR /&gt;
           next i&lt;BR /&gt;
&lt;BR /&gt;
where nSide is the variable for the number of side&lt;BR /&gt;
and i, the numerotation of EDGE, incremented at each loop &lt;BR /&gt;
&lt;BR /&gt;
i made it for VERT and EDGE, but impossible to realise with polygon&lt;BR /&gt;
&lt;BR /&gt;
if anyone got the answer.....&lt;/T&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 28 Jan 2009 01:05:26 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Polygon-with-variable-number-of-sides/m-p/162620#M25742</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-01-28T01:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: Polygon with variable number of sides</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Polygon-with-variable-number-of-sides/m-p/162621#M25743</link>
      <description>&lt;BLOCKQUOTE&gt;Jevrod wrote:&lt;BR /&gt;hello&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
is it possible to create a polygon with a variable number of sides ?&lt;BR /&gt;
&lt;BR /&gt;
something like this ?&lt;BR /&gt;
&lt;BR /&gt;
PGON   nSide, 0, -1,   &lt;BR /&gt;
           for i to nSide &lt;BR /&gt;
             i,&lt;BR /&gt;
           next i&lt;BR /&gt;
&lt;BR /&gt;
where nSide is the variable for the number of side&lt;BR /&gt;
and i, the numerotation of EDGE, incremented at each loop &lt;BR /&gt;
&lt;BR /&gt;
i made it for VERT and EDGE, but impossible to realise with polygon&lt;BR /&gt;
&lt;BR /&gt;
if anyone got the answer.....&lt;/BLOCKQUOTE&gt;

You won't be able to put a for/next loop in a PGON command.&lt;BR /&gt;
But if you only had a limited number of sides required you could say ...&lt;BR /&gt;
&lt;BR /&gt;
IF nSide =  3 then&lt;BR /&gt;
PGON 3, vect, status, edge1, edge2, ... edgen&lt;BR /&gt;
ENDIF&lt;BR /&gt;
&lt;BR /&gt;
IF nSide =  4 then&lt;BR /&gt;
PGON 4, vect, status, edge1, edge2, ... edgen&lt;BR /&gt;
ENDIF&lt;BR /&gt;
&lt;BR /&gt;
IF nSide =  5 then&lt;BR /&gt;
PGON 5, vect, status, edge1, edge2, ... edgen&lt;BR /&gt;
ENDIF&lt;BR /&gt;
&lt;BR /&gt;
.... etc.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
      <pubDate>Wed, 28 Jan 2009 03:00:19 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Polygon-with-variable-number-of-sides/m-p/162621#M25743</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2009-01-28T03:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: Polygon with variable number of sides</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Polygon-with-variable-number-of-sides/m-p/162622#M25744</link>
      <description>If the computation of the points lends itself to iteration (presumably the reason you shows a for-loop), then I think that you can assemble the points into the parameter buffer in your loop by outputting them to the buffer with PUT and then use a GET (or USE) with the PGON to retrieve the computed values. &lt;BR /&gt;
&lt;BR /&gt;
David Nicholson-Cole gives many examples of PUT/GET combinations in the GDL Cookbook.  See:&lt;BR /&gt;
&lt;A href="http://archicad-talk.graphisoft.com/viewtopic.php?t=23839" target="_blank"&gt;&lt;LINK_TEXT text="http://archicad-talk.graphisoft.com/vie ... hp?t=23839"&gt;http://archicad-talk.graphisoft.com/viewtopic.php?t=23839&lt;/LINK_TEXT&gt;&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Cheers,&lt;BR /&gt;
Karl</description>
      <pubDate>Wed, 28 Jan 2009 05:12:12 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Polygon-with-variable-number-of-sides/m-p/162622#M25744</guid>
      <dc:creator>Karl Ottenstein</dc:creator>
      <dc:date>2009-01-28T05:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: Polygon with variable number of sides</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Polygon-with-variable-number-of-sides/m-p/162623#M25745</link>
      <description>yeah, thanks for the PUT GET command, it's exactly what i need</description>
      <pubDate>Wed, 28 Jan 2009 18:40:38 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Polygon-with-variable-number-of-sides/m-p/162623#M25745</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-01-28T18:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: Polygon with variable number of sides</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Polygon-with-variable-number-of-sides/m-p/162624#M25746</link>
      <description>Of course, you can write pgons under this form &lt;BR /&gt;
&lt;BR /&gt;
if bCond1 then&lt;BR /&gt;
	put 6, 0, 16,  1, 2, 3,  4,  5,  6    ! # 1&lt;BR /&gt;
	put 6, 0, 16,  7, 8, 9, 10, 11, 12    ! # 2&lt;BR /&gt;
else    &lt;BR /&gt;
	put 8, 0, 16,  1,  2,  3,  4,  5,  6,  7,  8    ! # 1&lt;BR /&gt;
	put 8, 0, 16,  9, 10, 11, 12, 13, 14, 15, 16    ! # 2&lt;BR /&gt;
endif&lt;BR /&gt;
&lt;BR /&gt;
for k = 1 to 2&lt;BR /&gt;
	pgon get(nsp/(3-k))&lt;BR /&gt;
next k&lt;BR /&gt;
&lt;BR /&gt;
But ... since you HAVE to declare each pgon, it is easier to write them directly.&lt;BR /&gt;
I don't think put/get statements are of any help for pgons, in general. &lt;BR /&gt;
It would be difficult to deal with buffer polycount.&lt;BR /&gt;
Barry's solution seems more relevant. &lt;BR /&gt;
&lt;BR /&gt;
if bCond1 then&lt;BR /&gt;
	pgon  6, 0, 16,  1, 2, 3,  4,  5,  6    ! # 1 &lt;BR /&gt;
	pgon  6, 0, 16,  7, 8, 9, 10, 11, 12    ! # 2 &lt;BR /&gt;
else    &lt;BR /&gt;
	pgon  8, 0, 16,  1,  2,  3,  4,  5,  6,  7,  8    ! # 1 &lt;BR /&gt;
	pgon  8, 0, 16,  9, 10, 11, 12, 13, 14, 15, 16    ! # 2&lt;BR /&gt;
endif&lt;BR /&gt;
 &lt;BR /&gt;
For a single planar pgon with a variable number of sides, put/get statements can work.&lt;BR /&gt;
There are more simple ways to achieve this. &lt;BR /&gt;
Use primitives only when not any current tool can achieve what you want.</description>
      <pubDate>Wed, 28 Jan 2009 20:42:22 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Polygon-with-variable-number-of-sides/m-p/162624#M25746</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-01-28T20:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: Polygon with variable number of sides</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Polygon-with-variable-number-of-sides/m-p/162625#M25747</link>
      <description>&lt;BLOCKQUOTE&gt;Karl wrote:&lt;BR /&gt;If the computation of the points lends itself to iteration (presumably the reason you shows a for-loop), then I think that you can assemble the points into the parameter buffer in your loop by outputting them to the buffer with PUT and then use a GET (or USE) with the PGON to retrieve the computed values.&lt;BR /&gt;
Cheers,&lt;BR /&gt;
Karl&lt;/BLOCKQUOTE&gt;

I did that, using put get, worked for me. I was making coon object so the script was bit complicated, but, eventually got it assembled for up to 9x9 point coon, using two loops to calculate values and then 4 loops to assign them in proper order</description>
      <pubDate>Sat, 07 Feb 2009 01:16:10 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Polygon-with-variable-number-of-sides/m-p/162625#M25747</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-02-07T01:16:10Z</dc:date>
    </item>
  </channel>
</rss>

