<?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: Problems accessing layer information with decribe() in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/problems-accessing-layer-information-with-decribe/m-p/319096#M11219</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I am writing a standalone python script (i.e not within arcmap) that attempts to extract the coordinates of selected features (as they appear selected in the current map document).&amp;nbsp; The commands that make up my script (see below) work fine if I execute them within the python window in arcmap but not when I try to use them within a standalone script.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;mxd= mapping.MapDocument(r'c:\GIS\project\map.mxd)&lt;/STRONG&gt;&lt;BR /&gt;myLyr= mapping.ListLayers(mxd, 'features')[0]&lt;BR /&gt;desc= Describe(myLyr)&lt;BR /&gt;&lt;BR /&gt;NB. 'features' is the name of a point feature layer. The datasource of this layer is within a personal geodatabase i.e. within test.gdb. &lt;BR /&gt;&lt;BR /&gt;The script blows us when it gets to the last command in spite of the fact that myLyr is indeed a layer (I checked this when debugging). I cannot think of what I am doing wrong so any help will be appreciated.&lt;BR /&gt;&lt;BR /&gt;thanks&lt;BR /&gt;&lt;BR /&gt;marc&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You have no closing single quote in your mxd line, so this should be a syntax error and not run at all.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Apr 2012 15:58:29 GMT</pubDate>
    <dc:creator>MathewCoyle</dc:creator>
    <dc:date>2012-04-04T15:58:29Z</dc:date>
    <item>
      <title>Problems accessing layer information with decribe()</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/problems-accessing-layer-information-with-decribe/m-p/319093#M11216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am writing a standalone python script (i.e not within arcmap) that attempts to extract the coordinates of selected features (as they appear selected in the current map document).&amp;nbsp; The commands that make up my script (see below) work fine if I execute them within the python window in arcmap but not when I try to use them within a standalone script.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd= mapping.MapDocument(r'c:\GIS\project\map.mxd)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;myLyr= mapping.ListLayers(mxd, 'features')[0]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;desc= Describe(myLyr)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;NB. 'features' is the name of a point feature layer. The datasource of this layer is within a personal geodatabase i.e. within test.gdb. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The script blows us when it gets to the last command in spite of the fact that myLyr is indeed a layer (I checked this when debugging). I cannot think of what I am doing wrong so any help will be appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;marc&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Apr 2012 22:24:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/problems-accessing-layer-information-with-decribe/m-p/319093#M11216</guid>
      <dc:creator>MLLO</dc:creator>
      <dc:date>2012-04-03T22:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: Problems accessing layer information with decribe()</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/problems-accessing-layer-information-with-decribe/m-p/319094#M11217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;try:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;desc= &lt;/SPAN&gt;&lt;STRONG&gt;arcpy.&lt;/STRONG&gt;&lt;SPAN&gt;Describe(myLyr)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2012 05:41:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/problems-accessing-layer-information-with-decribe/m-p/319094#M11217</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2012-04-04T05:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: Problems accessing layer information with decribe()</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/problems-accessing-layer-information-with-decribe/m-p/319095#M11218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I used the statement: from arcpy import *&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So in theory I would not need to specify arcpy.Describe() ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;M.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2012 15:51:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/problems-accessing-layer-information-with-decribe/m-p/319095#M11218</guid>
      <dc:creator>MLLO</dc:creator>
      <dc:date>2012-04-04T15:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: Problems accessing layer information with decribe()</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/problems-accessing-layer-information-with-decribe/m-p/319096#M11219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I am writing a standalone python script (i.e not within arcmap) that attempts to extract the coordinates of selected features (as they appear selected in the current map document).&amp;nbsp; The commands that make up my script (see below) work fine if I execute them within the python window in arcmap but not when I try to use them within a standalone script.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;mxd= mapping.MapDocument(r'c:\GIS\project\map.mxd)&lt;/STRONG&gt;&lt;BR /&gt;myLyr= mapping.ListLayers(mxd, 'features')[0]&lt;BR /&gt;desc= Describe(myLyr)&lt;BR /&gt;&lt;BR /&gt;NB. 'features' is the name of a point feature layer. The datasource of this layer is within a personal geodatabase i.e. within test.gdb. &lt;BR /&gt;&lt;BR /&gt;The script blows us when it gets to the last command in spite of the fact that myLyr is indeed a layer (I checked this when debugging). I cannot think of what I am doing wrong so any help will be appreciated.&lt;BR /&gt;&lt;BR /&gt;thanks&lt;BR /&gt;&lt;BR /&gt;marc&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You have no closing single quote in your mxd line, so this should be a syntax error and not run at all.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2012 15:58:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/problems-accessing-layer-information-with-decribe/m-p/319096#M11219</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2012-04-04T15:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: Problems accessing layer information with decribe()</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/problems-accessing-layer-information-with-decribe/m-p/319097#M11220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;You have no closing single quote in your mxd line, so this should be a syntax error and not run at all.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry, my mistake... this was a typo when copying. The code is as follows...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;from arcpy import *&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd= mapping.MapDocument(r'c:\GIS\project\map.mxd')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;myLyr= mapping.ListLayers(mxd, 'features')[0]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;desc= Describe(myLyr)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;NB. 'features' is the name of a point feature layer. The datasource of this layer is within a personal geodatabase i.e. within test.gdb.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2012 16:21:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/problems-accessing-layer-information-with-decribe/m-p/319097#M11220</guid>
      <dc:creator>MLLO</dc:creator>
      <dc:date>2012-04-04T16:21:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problems accessing layer information with decribe()</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/problems-accessing-layer-information-with-decribe/m-p/319098#M11221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Just to clarify. A personal geodatabase is an .mdb file, a file geodatabase is a .gdb.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can try getting the feature class describe instead of layer using this, see if that works.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;desc = Describe(myLyr.dataSource)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edit:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If you do want to get the layer describe you can do this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;MakeFeatureLayer_management(myLyr, "describe_me")
desc = Describe("describe_me")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:09:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/problems-accessing-layer-information-with-decribe/m-p/319098#M11221</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2021-12-11T15:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: Problems accessing layer information with decribe()</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/problems-accessing-layer-information-with-decribe/m-p/319099#M11222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you mzcoyle,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Your first suggestion (1) but not (2)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;desc = Describe(myLyr.dataSource)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(2)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;MakeFeatureLayer_management(myLyr, "describe_me")
desc = Describe("describe_me")&lt;/PRE&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:10:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/problems-accessing-layer-information-with-decribe/m-p/319099#M11222</guid>
      <dc:creator>MLLO</dc:creator>
      <dc:date>2021-12-11T15:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: Problems accessing layer information with decribe()</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/problems-accessing-layer-information-with-decribe/m-p/319100#M11223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think the layer describe function is one that works in the ArcMap command line window but not in stand alone python&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I ran this code&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
mxd=arcpy.mapping.MapDocument('CURRENT')
df=arcpy.mapping.ListDataFrames(mxd,'Wyoming')[0]
test_layer=arcpy.mapping.ListLayers(mxd,'*',df)[1]
desc=arcpy.Describe(test_layer)
desc.FIDSet
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I get a result set back from this commands.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Running the same commands in an IDLE window, with the exception of using the full path instead of CURRENT I get this message:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color:&amp;quot;#FF0000&amp;quot;;"&gt;Traceback (most recent call last):&lt;BR /&gt; File "&amp;lt;pyshell#103&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;BR /&gt; desc=arcpy.Describe(test_layer)&lt;BR /&gt; File "C:\ArcGIS\Desktop10.0\arcpy\arcpy\__init__.py", line 862, in Describe&lt;BR /&gt; return gp.describe(*args)&lt;BR /&gt; File "C:\ArcGIS\Desktop10.0\arcpy\arcpy\geoprocessing\_base.py", line 372, in describe&lt;BR /&gt; self._gp.Describe(*gp_fixargs(args)))&lt;BR /&gt;IOError: S_USA.State selection&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I seem to recall another discussion where things don't work the same between stand alone and ArcMap arcpy.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Found the thread:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/15433-Python-Errors-in-IDLE-but-Works-in-ArcCatalog" rel="nofollow noopener noreferrer" target="_blank"&gt;http://forums.arcgis.com/threads/15433-Python-Errors-in-IDLE-but-Works-in-ArcCatalog&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ESRI really needs to fix this behavior. It is very frustrating to try to develop code that should behave identically but instead is dependent on which version of arcpy is being used.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:10:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/problems-accessing-layer-information-with-decribe/m-p/319100#M11223</guid>
      <dc:creator>David_JAnderson</dc:creator>
      <dc:date>2021-12-11T15:10:04Z</dc:date>
    </item>
  </channel>
</rss>

