<?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: Python shapefiles, centroids, and CAD in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-shapefiles-centroids-and-cad/m-p/46338#M3718</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Misinterpreted instructions given to me. What I am actually doing now is intersecting two feature classes, adding 5 fields, exporting those fields to a separate table, calculating cendroid, bringing those fields back into the intersecting feature class, making a point feautre class, and exporting all the info to CAD. I am also using ArcGIS model builder for now, but will use script or anything else if I have to. Just need to get the job done. If you have any advice for this, I would be greatful. If not, good luck with your project.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Jun 2013 15:11:46 GMT</pubDate>
    <dc:creator>ChristopherGraf</dc:creator>
    <dc:date>2013-06-12T15:11:46Z</dc:date>
    <item>
      <title>Python shapefiles, centroids, and CAD</title>
      <link>https://community.esri.com/t5/python-questions/python-shapefiles-centroids-and-cad/m-p/46336#M3716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to write a python script that can draw a polygon or some just some sort of selection square to select shapefiles on ArcMap, then calculate their centroids, add fields for CAD export, and export to AutoCAD. I was thinking of starting out with the ArcMap selection for "Edit Start" and seeing if I can use that to select the shapefiles and go from there. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; Does anybody have any other good ideas? Please let me know&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;cgraf1&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jun 2013 13:42:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-shapefiles-centroids-and-cad/m-p/46336#M3716</guid>
      <dc:creator>ChristopherGraf</dc:creator>
      <dc:date>2013-06-10T13:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: Python shapefiles, centroids, and CAD</title>
      <link>https://community.esri.com/t5/python-questions/python-shapefiles-centroids-and-cad/m-p/46337#M3717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have similar interest.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What will define the polygon? Input feature class? User draws on screen? The map view?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What ArcGIS version are you using?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001w00000009000000" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001w00000009000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This Python code sets the environment extent (bounding box) that limits where geoprocessing tools operate:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy
from arcpy import env

# Set the extent environment using a keyword.
arcpy.env.extent = "MAXOF"

# Set the extent environment using the Extent class.
arcpy.env.extent = arcpy.Extent(-107.0, 38.0, -104.0, 40.0)

# Set the extent environment using a space-delimited string.
arcpy.env.extent = "-107.0 38.0 -104.0 40.0"
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:49:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-shapefiles-centroids-and-cad/m-p/46337#M3717</guid>
      <dc:creator>RobParsons</dc:creator>
      <dc:date>2021-12-10T21:49:05Z</dc:date>
    </item>
    <item>
      <title>Re: Python shapefiles, centroids, and CAD</title>
      <link>https://community.esri.com/t5/python-questions/python-shapefiles-centroids-and-cad/m-p/46338#M3718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Misinterpreted instructions given to me. What I am actually doing now is intersecting two feature classes, adding 5 fields, exporting those fields to a separate table, calculating cendroid, bringing those fields back into the intersecting feature class, making a point feautre class, and exporting all the info to CAD. I am also using ArcGIS model builder for now, but will use script or anything else if I have to. Just need to get the job done. If you have any advice for this, I would be greatful. If not, good luck with your project.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jun 2013 15:11:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-shapefiles-centroids-and-cad/m-p/46338#M3718</guid>
      <dc:creator>ChristopherGraf</dc:creator>
      <dc:date>2013-06-12T15:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: Python shapefiles, centroids, and CAD</title>
      <link>https://community.esri.com/t5/python-questions/python-shapefiles-centroids-and-cad/m-p/46339#M3719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You don't say here what version you are on.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I always think it wise when working out a workflow to do it "by hand" ie in ArcMap / Catalog using the tools first, before trying to automate it with modelbuilder or python scripting.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Intersect is there in the tool box. Add field by opening the attribute table and add the required fields.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Not sure why you need to then export these to a separate table.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The centroid can be added to the attributes by using "Calculate Geometry". Add 2 more fields CentX, CentY, for each click on the column header, right click and select "Calculate Geometry".&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;By now you should have everything in the feature class that you need. Poly to Point if you need it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want to go out to CAD, I think you will need the data interop extension.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers and good luck,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Neil&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jun 2013 18:26:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-shapefiles-centroids-and-cad/m-p/46339#M3719</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2013-06-12T18:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: Python shapefiles, centroids, and CAD</title>
      <link>https://community.esri.com/t5/python-questions/python-shapefiles-centroids-and-cad/m-p/46340#M3720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Calculate Geometry is not a tool. I can right click and use it, but I am trying to make it automatic. The purpose of this is to save time for when field workers have new data they want to put into CAD. This is the process my boss has done many times manually, but now wants automated to save time and effort.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jun 2013 18:46:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-shapefiles-centroids-and-cad/m-p/46340#M3720</guid>
      <dc:creator>ChristopherGraf</dc:creator>
      <dc:date>2013-06-12T18:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: Python shapefiles, centroids, and CAD</title>
      <link>https://community.esri.com/t5/python-questions/python-shapefiles-centroids-and-cad/m-p/46341#M3721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Also, I am in ArcMap 10.1&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jun 2013 18:46:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-shapefiles-centroids-and-cad/m-p/46341#M3721</guid>
      <dc:creator>ChristopherGraf</dc:creator>
      <dc:date>2013-06-12T18:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: Python shapefiles, centroids, and CAD</title>
      <link>https://community.esri.com/t5/python-questions/python-shapefiles-centroids-and-cad/m-p/46342#M3722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Calculate Geometry is not a tool. I can right click and use it, but I am trying to make it automatic. The purpose of this is to save time for when field workers have new data they want to put into CAD. This is the process my boss has done many times manually, but now wants automated to save time and effort.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You can perform the centroid calculation using &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//00170000004m000000z"&gt;CalculateField&lt;/A&gt;&lt;SPAN&gt;, one of the code samples shows how to use it to add a centroid.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jun 2013 23:49:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-shapefiles-centroids-and-cad/m-p/46342#M3722</guid>
      <dc:creator>ShaunWalbridge</dc:creator>
      <dc:date>2013-06-12T23:49:41Z</dc:date>
    </item>
    <item>
      <title>Re: Python shapefiles, centroids, and CAD</title>
      <link>https://community.esri.com/t5/python-questions/python-shapefiles-centroids-and-cad/m-p/46343#M3723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have used many different iterations of expressions trying to use the CalculateField tool, including the example shown on the link, but even when it seems to run correctly, I get all 0's as the calculated result for all the centroids, which I know is not correct.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2013 11:17:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-shapefiles-centroids-and-cad/m-p/46343#M3723</guid>
      <dc:creator>ChristopherGraf</dc:creator>
      <dc:date>2013-06-13T11:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: Python shapefiles, centroids, and CAD</title>
      <link>https://community.esri.com/t5/python-questions/python-shapefiles-centroids-and-cad/m-p/46344#M3724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I figured out my problem. I was trying to calculate the centroids AFTER I brought it over to a table, so in the model I was trying to calculate the centroids of a table, which doesn't exist....&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2013 13:21:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-shapefiles-centroids-and-cad/m-p/46344#M3724</guid>
      <dc:creator>ChristopherGraf</dc:creator>
      <dc:date>2013-06-13T13:21:14Z</dc:date>
    </item>
  </channel>
</rss>

