<?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: PolyOperation in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/PolyOperation/m-p/326740#M2452</link>
    <description>&lt;P&gt;As far as I now You can execute&amp;nbsp; only one operation at a time. For multiple operations You have to substract from the resulting polygon. I think it is easier to use the Dictionary (StoreDictPolygon -parameter&amp;nbsp; etc.) type because the resulting polygon is ready to use in the next loop. The old way is tricky to use.&lt;/P&gt;&lt;P&gt;You can also define the polygon with holes if all holes are inside the contour.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Jan 2022 06:24:00 GMT</pubDate>
    <dc:creator>Pertti Paasky</dc:creator>
    <dc:date>2022-01-11T06:24:00Z</dc:date>
    <item>
      <title>PolyOperation</title>
      <link>https://community.graphisoft.com/t5/GDL/PolyOperation/m-p/326352#M2450</link>
      <description>&lt;P&gt;Is There a way to get multiple subtractions to he same polygonusing?&lt;/P&gt;
&lt;P&gt;Thx for your attention&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;ch = INITADDONSCOPE ("PolyOperations", "", "")

PREPAREFUNCTION ch, "CreateContainer", "mySourceContainer", ""
PREPAREFUNCTION ch, "CreateContainer", "myDestinationContainer", ""

PREPAREFUNCTION ch, "SetSourceContainer", "mySourceContainer", ""
PREPAREFUNCTION ch, "SetDestinationContainer", "myDestinationContainer", ""



!!!=== 1th Polygon

dim vertArr1[][]

nVertices1 = 4
ii = 0
FOR i = 1 to vardim2(p1_coord) step 2
ii = 1 + ii
vertArr1[ii][1] = p1_coord[1][i]
vertArr1[ii][2] = p1_coord[1][i+1]
vertArr1[ii][3] = 0
NEXT i
ii = 0

PREPAREFUNCTION ch, "Store", "poly1_1", nVertices1, 1, vertArr1, nVertices1

!================

!!! holes polygons

polyg_hole = 2

FOR iii = 1 to polyg_hole

ii = 0
nVertices2 = N_polyg[iii]
FOR i = 1 to nVertices2*2 step 2
ii = 1 + ii
vertArr[ii][1] = pn_coord[iii][i]
vertArr[ii][2] = pn_coord[iii][i+1]
vertArr[ii][3] = 0
NEXT i
ii = 0
nomepoly2 = "poly2_"+str(iii,1,0)
PREPAREFUNCTION ch, "Store", nomepoly2, nVertices2, 1, vertarr, nVertices2

NEXT iii

!!!! ===== 1th operation

numPoly = CALLFUNCTION (ch, "poly1_1 - poly2_1", "", resPolyIDArray)





!!!! ===== 2th operation

polyXXX = ???????? !!=== result of first operation

numPoly = CALLFUNCTION (ch, "polyXXX  - poly2_2", "", resPolyIDArray)



.........



!!! see this example https://gdl.graphisoft.com/reference-guide/polygon-operations-extension





for i = 1 to numPoly
polygonID = resPolyIDArray[i]

gosub 100 ! Get one polygon contour data (without contours)
fill 1
pen 1
if nsp &amp;gt; 0 then
poly2_ nsp/3, 2, get(nsp)
endif
line_property 2
gosub 101 ! Draw one polygon contour lines
next i&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2022 00:59:25 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/PolyOperation/m-p/326352#M2450</guid>
      <dc:creator>FerDE</dc:creator>
      <dc:date>2022-01-11T00:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: PolyOperation</title>
      <link>https://community.graphisoft.com/t5/GDL/PolyOperation/m-p/326353#M2451</link>
      <description>&lt;P&gt;Note; there is missing some code but, i hope, the question is clear.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 11:44:27 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/PolyOperation/m-p/326353#M2451</guid>
      <dc:creator>FerDE</dc:creator>
      <dc:date>2022-01-06T11:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: PolyOperation</title>
      <link>https://community.graphisoft.com/t5/GDL/PolyOperation/m-p/326740#M2452</link>
      <description>&lt;P&gt;As far as I now You can execute&amp;nbsp; only one operation at a time. For multiple operations You have to substract from the resulting polygon. I think it is easier to use the Dictionary (StoreDictPolygon -parameter&amp;nbsp; etc.) type because the resulting polygon is ready to use in the next loop. The old way is tricky to use.&lt;/P&gt;&lt;P&gt;You can also define the polygon with holes if all holes are inside the contour.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2022 06:24:00 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/PolyOperation/m-p/326740#M2452</guid>
      <dc:creator>Pertti Paasky</dc:creator>
      <dc:date>2022-01-11T06:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: PolyOperation</title>
      <link>https://community.graphisoft.com/t5/GDL/PolyOperation/m-p/326759#M2453</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;An operation always works on the source container, and puts the results in the destination container. The IDs of the resulting polygons are returned from CALLFUNCTION in resPolyIDArray. Re-define source and destination containers between operations (this doesn't change the content of the containers).&lt;/P&gt;
&lt;P&gt;Be prepared that each operation can result in many polygons, if you are chaining operations the second operation has to be done on each of the results of the first. You can either keep track of returned polygon IDs from many calls, or disregard them and use GetDestinationPolygons to get the content ids when the container contains all results.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2022 09:45:43 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/PolyOperation/m-p/326759#M2453</guid>
      <dc:creator>Peter Baksa</dc:creator>
      <dc:date>2022-01-11T09:45:43Z</dc:date>
    </item>
  </channel>
</rss>

