<?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 manual selection as input parameter for a script in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/manual-selection-as-input-parameter-for-a-script/m-p/274944#M21236</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN style="font-style:italic;"&gt;&lt;BR /&gt;I&amp;nbsp; need a arcpy&amp;nbsp; script to process data from a selection, it's made manually in arcmap.&lt;BR /&gt;the selection is part of a mesh, to print data from a specified field.&lt;BR /&gt;&lt;BR /&gt;Can i put a selection made ??????manually as input parameter for a script?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;until now, I have a script that processes the selection stored in a layer that is displayed in the TOC&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt; #import arcpy module
#
import arcpy


# Load the MXD&amp;nbsp; default document
#
mxd = arcpy.mapping.MapDocument("CURRENT")


# Define the TOC default Data Frame
#
df = arcpy.mapping.ListDataFrames(mxd, "Capas")[0]


#access to the target (mesh selection), stored in a layer,
#By selecting the corresponding layer located on the TOC
#
fc = arcpy.mapping.ListLayers(mxd,"",df)[0]


#define of the field to consult.
#
field = "idMalla"

print "campo idMalla: "
# query&amp;nbsp; for reading&amp;nbsp; a specified field.
#
cursor = arcpy.SearchCursor(fc)
for row in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print(row.getValue(field))


# delete memory
del mxd, df
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]27638[/ATTACH]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Sep 2013 15:22:44 GMT</pubDate>
    <dc:creator>oscarespitia</dc:creator>
    <dc:date>2013-09-20T15:22:44Z</dc:date>
    <item>
      <title>manual selection as input parameter for a script</title>
      <link>https://community.esri.com/t5/python-questions/manual-selection-as-input-parameter-for-a-script/m-p/274944#M21236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN style="font-style:italic;"&gt;&lt;BR /&gt;I&amp;nbsp; need a arcpy&amp;nbsp; script to process data from a selection, it's made manually in arcmap.&lt;BR /&gt;the selection is part of a mesh, to print data from a specified field.&lt;BR /&gt;&lt;BR /&gt;Can i put a selection made ??????manually as input parameter for a script?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;until now, I have a script that processes the selection stored in a layer that is displayed in the TOC&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt; #import arcpy module
#
import arcpy


# Load the MXD&amp;nbsp; default document
#
mxd = arcpy.mapping.MapDocument("CURRENT")


# Define the TOC default Data Frame
#
df = arcpy.mapping.ListDataFrames(mxd, "Capas")[0]


#access to the target (mesh selection), stored in a layer,
#By selecting the corresponding layer located on the TOC
#
fc = arcpy.mapping.ListLayers(mxd,"",df)[0]


#define of the field to consult.
#
field = "idMalla"

print "campo idMalla: "
# query&amp;nbsp; for reading&amp;nbsp; a specified field.
#
cursor = arcpy.SearchCursor(fc)
for row in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print(row.getValue(field))


# delete memory
del mxd, df
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]27638[/ATTACH]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Sep 2013 15:22:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/manual-selection-as-input-parameter-for-a-script/m-p/274944#M21236</guid>
      <dc:creator>oscarespitia</dc:creator>
      <dc:date>2013-09-20T15:22:44Z</dc:date>
    </item>
  </channel>
</rss>

