<?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 center of polygon area in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/center-of-polygon-area/m-p/346282#M79454</link>
    <description>hello&lt;BR /&gt;
i need to get the center of area of any polygon.&lt;BR /&gt;
it should be always inside the polygon&lt;BR /&gt;
thanks</description>
    <pubDate>Fri, 16 Nov 2001 07:17:13 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2001-11-16T07:17:13Z</dc:date>
    <item>
      <title>center of polygon area</title>
      <link>https://forums.autodesk.com/t5/vba-forum/center-of-polygon-area/m-p/346282#M79454</link>
      <description>hello&lt;BR /&gt;
i need to get the center of area of any polygon.&lt;BR /&gt;
it should be always inside the polygon&lt;BR /&gt;
thanks</description>
      <pubDate>Fri, 16 Nov 2001 07:17:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/center-of-polygon-area/m-p/346282#M79454</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-11-16T07:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: center of polygon area</title>
      <link>https://forums.autodesk.com/t5/vba-forum/center-of-polygon-area/m-p/346283#M79455</link>
      <description>Like I said: create region from the ploygon and query the Centroid property&lt;BR /&gt;
of the region.&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
http://www.acadx.com&lt;BR /&gt;
&lt;BR /&gt;
Good judgment comes from experience.&lt;BR /&gt;
Experience comes from bad judgment.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Jimmy Lopez" &lt;GEOMAPA&gt; wrote in message&lt;BR /&gt;
news:6AEF0454B8375276CF4972118E0E37BF@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; hello&lt;BR /&gt;
&amp;gt; i need to get the center of area of any polygon.&lt;BR /&gt;
&amp;gt; it should be always inside the polygon&lt;BR /&gt;
&amp;gt; thanks&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/GEOMAPA&gt;</description>
      <pubDate>Fri, 16 Nov 2001 08:34:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/center-of-polygon-area/m-p/346283#M79455</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-11-16T08:34:46Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/center-of-polygon-area/m-p/346284#M79456</link>
      <description>Jimmy,&lt;BR /&gt;
&lt;BR /&gt;
Here is how that is done.&lt;BR /&gt;
&lt;BR /&gt;
Joe&lt;BR /&gt;
&lt;BR /&gt;
Public Sub GetCenterOfPolygon()&lt;BR /&gt;
Dim Entity As AcadEntity&lt;BR /&gt;
Dim Region As AcadRegion&lt;BR /&gt;
Dim Polylist(0 To 0) As AcadEntity&lt;BR /&gt;
Dim Point(0 To 2) As Double&lt;BR /&gt;
Dim Index As Integer&lt;BR /&gt;
&lt;BR /&gt;
  ThisDrawing.Utility.GetEntity Entity, Point, "Select polygon"&lt;BR /&gt;
&lt;BR /&gt;
  If Entity.ObjectName = "AcDbPolyline" Then&lt;BR /&gt;
    Set Polylist(0) = Entity&lt;BR /&gt;
    ThisDrawing.ModelSpace.AddRegion Polylist&lt;BR /&gt;
&lt;BR /&gt;
    'Find centroid&lt;BR /&gt;
    For Index = 0 To ThisDrawing.ModelSpace.Count - 1&lt;BR /&gt;
      If ThisDrawing.ModelSpace.Item(Index).ObjectName = "AcDbRegion" Then  'Region ?&lt;BR /&gt;
        Set Region = ThisDrawing.ModelSpace.Item(Index)&lt;BR /&gt;
        MsgBox "Centroid X: " &amp;amp; Region.Centroid(0) &amp;amp; vbCrLf &amp;amp; "Centroid Y: " &amp;amp; Region.Centroid(1)&lt;BR /&gt;
      End If&lt;BR /&gt;
    Next Index&lt;BR /&gt;
  End If&lt;BR /&gt;
  'delete region when done&lt;BR /&gt;
  Region.Delete&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Frank Oquendo" &lt;FRANKO&gt; wrote in message news:A8F2116895CC096B5EF9D0CF5B07A428@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; Like I said: create region from the ploygon and query the Centroid property&lt;BR /&gt;
&amp;gt; of the region.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; http://www.acadx.com&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Good judgment comes from experience.&lt;BR /&gt;
&amp;gt; Experience comes from bad judgment.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; "Jimmy Lopez" &lt;GEOMAPA&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:6AEF0454B8375276CF4972118E0E37BF@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; &amp;gt; hello&lt;BR /&gt;
&amp;gt; &amp;gt; i need to get the center of area of any polygon.&lt;BR /&gt;
&amp;gt; &amp;gt; it should be always inside the polygon&lt;BR /&gt;
&amp;gt; &amp;gt; thanks&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/GEOMAPA&gt;&lt;/FRANKO&gt;</description>
      <pubDate>Fri, 16 Nov 2001 10:29:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/center-of-polygon-area/m-p/346284#M79456</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-11-16T10:29:58Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/center-of-polygon-area/m-p/346285#M79457</link>
      <description>hello joe!!&lt;BR /&gt;
thanks for your help.&lt;BR /&gt;
Maybe i didn't explain what i need. sometimes my english is not good.&lt;BR /&gt;
i have a function for getting the centroid of polygon, like the application&lt;BR /&gt;
you sent me, but i don't create a region.&lt;BR /&gt;
i just sum x and y coordinates and i get the centroide.&lt;BR /&gt;
&lt;BR /&gt;
what a really need is, for example in an irregular polygon like an L, the&lt;BR /&gt;
centroid is outside of it.&lt;BR /&gt;
i need the centroid always inside. i don't know if i'm talking about&lt;BR /&gt;
centroid and this is wrong.&lt;BR /&gt;
do you know Autocad Map?? have you created topologies?? i need the point&lt;BR /&gt;
like autocad map puts the centroid.&lt;BR /&gt;
or like arcinfo the same.&lt;BR /&gt;
&lt;BR /&gt;
thanks very much for your time.&lt;BR /&gt;
I develope applications in AutoCad and AutoCad Map, working with topologies,&lt;BR /&gt;
object data, databases etc.&lt;BR /&gt;
basically GIS, and sometimes i have 50000 polygons for processing.&lt;BR /&gt;
if i can help you anytime i'm here!!&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Joe Sutphin" &lt;JOESU&gt; wrote in message&lt;BR /&gt;
news:B95BE87555FA682FE3B64474116A1C9C@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; Jimmy,&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Here is how that is done.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Joe&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Public Sub GetCenterOfPolygon()&lt;BR /&gt;
&amp;gt; Dim Entity As AcadEntity&lt;BR /&gt;
&amp;gt; Dim Region As AcadRegion&lt;BR /&gt;
&amp;gt; Dim Polylist(0 To 0) As AcadEntity&lt;BR /&gt;
&amp;gt; Dim Point(0 To 2) As Double&lt;BR /&gt;
&amp;gt; Dim Index As Integer&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;   ThisDrawing.Utility.GetEntity Entity, Point, "Select polygon"&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;   If Entity.ObjectName = "AcDbPolyline" Then&lt;BR /&gt;
&amp;gt;     Set Polylist(0) = Entity&lt;BR /&gt;
&amp;gt;     ThisDrawing.ModelSpace.AddRegion Polylist&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;     'Find centroid&lt;BR /&gt;
&amp;gt;     For Index = 0 To ThisDrawing.ModelSpace.Count - 1&lt;BR /&gt;
&amp;gt;       If ThisDrawing.ModelSpace.Item(Index).ObjectName = "AcDbRegion" Then&lt;BR /&gt;
'Region ?&lt;BR /&gt;
&amp;gt;         Set Region = ThisDrawing.ModelSpace.Item(Index)&lt;BR /&gt;
&amp;gt;         MsgBox "Centroid X: " &amp;amp; Region.Centroid(0) &amp;amp; vbCrLf &amp;amp; "Centroid Y:&lt;BR /&gt;
" &amp;amp; Region.Centroid(1)&lt;BR /&gt;
&amp;gt;       End If&lt;BR /&gt;
&amp;gt;     Next Index&lt;BR /&gt;
&amp;gt;   End If&lt;BR /&gt;
&amp;gt;   'delete region when done&lt;BR /&gt;
&amp;gt;   Region.Delete&lt;BR /&gt;
&amp;gt; End Sub&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; "Frank Oquendo" &lt;FRANKO&gt; wrote in message&lt;BR /&gt;
news:A8F2116895CC096B5EF9D0CF5B07A428@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; &amp;gt; Like I said: create region from the ploygon and query the Centroid&lt;BR /&gt;
property&lt;BR /&gt;
&amp;gt; &amp;gt; of the region.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; --&lt;BR /&gt;
&amp;gt; &amp;gt; http://www.acadx.com&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Good judgment comes from experience.&lt;BR /&gt;
&amp;gt; &amp;gt; Experience comes from bad judgment.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; "Jimmy Lopez" &lt;GEOMAPA&gt; wrote in message&lt;BR /&gt;
&amp;gt; &amp;gt; news:6AEF0454B8375276CF4972118E0E37BF@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; hello&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; i need to get the center of area of any polygon.&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; it should be always inside the polygon&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; thanks&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/GEOMAPA&gt;&lt;/FRANKO&gt;&lt;/JOESU&gt;</description>
      <pubDate>Fri, 16 Nov 2001 10:57:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/center-of-polygon-area/m-p/346285#M79457</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-11-16T10:57:49Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/center-of-polygon-area/m-p/346286#M79458</link>
      <description>Hello Jimmy,&lt;BR /&gt;
I want to know if you have find a solution for your problem, because I have the seem.&lt;BR /&gt;
Thanks</description>
      <pubDate>Wed, 25 Jan 2006 00:31:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/center-of-polygon-area/m-p/346286#M79458</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-01-25T00:31:23Z</dc:date>
    </item>
  </channel>
</rss>

