<?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: ArcToolbox Error in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arctoolbox-error/m-p/1203747#M58751</link>
    <description>&lt;P&gt;I appreciate the help.&amp;nbsp; I actually got the tool to run through successfully yesterday. Oddly, no error was received.&amp;nbsp; I am trying to get a license for Microsoft Visual through my company's SOP.&amp;nbsp; So, that will likely take some time.&lt;/P&gt;</description>
    <pubDate>Wed, 17 Aug 2022 14:52:09 GMT</pubDate>
    <dc:creator>JohnMedema</dc:creator>
    <dc:date>2022-08-17T14:52:09Z</dc:date>
    <item>
      <title>ArcToolbox Error</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arctoolbox-error/m-p/1203291#M58686</link>
      <description>&lt;P&gt;my script is returning an error that I dont understand.&amp;nbsp;(see image below)&lt;/P&gt;&lt;P&gt;code snippet:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LFTcode.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/48730iC20623F84BAFEAF5/image-size/large?v=v2&amp;amp;px=999" role="button" title="LFTcode.png" alt="LFTcode.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LFT_Error.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/48729i0C389C3D9BDF08AB/image-size/large?v=v2&amp;amp;px=999" role="button" title="LFT_Error.png" alt="LFT_Error.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2022 14:42:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arctoolbox-error/m-p/1203291#M58686</guid>
      <dc:creator>JohnMedema</dc:creator>
      <dc:date>2022-08-16T14:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: ArcToolbox Error</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arctoolbox-error/m-p/1203322#M58695</link>
      <description>&lt;P&gt;Your layer object has things in it that are not shape, so it's choking on that. It might be a group or a table?&lt;/P&gt;&lt;P&gt;To debug your error, start by looking up Describe in the docs to see how it's used.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/describe.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/describe.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Look at what it returns, it's just an object. That object can then have properties and methods.&amp;nbsp; So in theory your syntax could work if Describe returns an object with the property "shapeType" but it's not.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Look at what it's returning in that docs page, it will be an object of type "Describe".&amp;nbsp;&lt;/P&gt;&lt;P&gt;It can return any of about 30 different things. If it's not returning a feature object it won't have a shape. Also it could be returning a NULL. You might want to use a try / except block to handle those cases.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;f = "unknown thing"
try:
  d = arcpy.Describe(thing)
  f = d.featureType
  shape = d.shapeType
except Exception as e:
  print("This is a", f)
  print(e)
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error message is a little confusing because Python thinks shapeType is a method, it would really be a property. But whatever, there is no shapeType defined on whatever object being returned by Describe for that input.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2022 15:37:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arctoolbox-error/m-p/1203322#M58695</guid>
      <dc:creator>Brian_Wilson</dc:creator>
      <dc:date>2022-08-16T15:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: ArcToolbox Error</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arctoolbox-error/m-p/1203343#M58697</link>
      <description>&lt;P&gt;Thank you for your input. I added some of your text to my script and ran it in the python window.&amp;nbsp; As you can see the print(arcpy.Describe(lyr).shapeType returns the point layers (sourced from my company portal) and the Polygons (all fgdb feature classes from separate fgdbs).&amp;nbsp; When I print(shape) I only get the polygon layers in my map.&amp;nbsp; Here is a snippet from my python window&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ESRIForum.png" style="width: 469px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/48737i694216F90B1062F9/image-size/large?v=v2&amp;amp;px=999" role="button" title="ESRIForum.png" alt="ESRIForum.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2022 16:08:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arctoolbox-error/m-p/1203343#M58697</guid>
      <dc:creator>JohnMedema</dc:creator>
      <dc:date>2022-08-16T16:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: ArcToolbox Error</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arctoolbox-error/m-p/1203577#M58724</link>
      <description>&lt;P&gt;Okay, when you look at FeatureLayers only, they all have a shapeType --- that's what I would expect. In your first example you did something like this, this will probably fail --&lt;/P&gt;&lt;LI-CODE lang="python"&gt;aprx = arcpy.mp.ArcGISProject("CURRENT")
mp = aprx.listMaps()[0]
for lyr in mp.listLayers():
  d = arcpy.Describe(lyr)
  print(d.shapeType)&lt;/LI-CODE&gt;&lt;P&gt;In the second one you did something more like this,&lt;/P&gt;&lt;LI-CODE lang="c"&gt;aprx = arcpy.mp.ArcGISProject("CURRENT")
mp = aprx.listMaps()[0]
for lyr in mp.listLayers():
  d = arcpy.Describe(lyr)
  if d.dataType == "FeatureLayer":
    print(d.shapeType)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My copy of ArcPro crashes on this code, because I have some layer in my map that it really hates, I think it's an external service. I have to go home now, but I will try it in Visual Studio Code tomorrow which is less prone to crashing.&amp;nbsp;By the way IDEs are great, I use Visual Studio Code, but many people prefer Spyder. They let you examine the values of objects without having to keep writing print() statements.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2022 00:03:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arctoolbox-error/m-p/1203577#M58724</guid>
      <dc:creator>Brian_Wilson</dc:creator>
      <dc:date>2022-08-17T00:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: ArcToolbox Error</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arctoolbox-error/m-p/1203747#M58751</link>
      <description>&lt;P&gt;I appreciate the help.&amp;nbsp; I actually got the tool to run through successfully yesterday. Oddly, no error was received.&amp;nbsp; I am trying to get a license for Microsoft Visual through my company's SOP.&amp;nbsp; So, that will likely take some time.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2022 14:52:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arctoolbox-error/m-p/1203747#M58751</guid>
      <dc:creator>JohnMedema</dc:creator>
      <dc:date>2022-08-17T14:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: ArcToolbox Error</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arctoolbox-error/m-p/1203778#M58760</link>
      <description>&lt;P&gt;"Visual Studio Code" is free.&lt;/P&gt;&lt;P&gt;&lt;A href="https://code.visualstudio.com/" target="_blank"&gt;https://code.visualstudio.com/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;There are community (free) and&amp;nbsp; commercial versions of "Visual Studio" but that is&amp;nbsp; totally different products. I used it for years as a C# programmer and later for Python but I think that VS Code is much better for Python and Javascript. I have not used it for C#. I use it for pretty much any text files these days, there are formatters for just about everything. It handles remote editing too, so, I can maintain projects that run on servers from my desktop.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2022 15:34:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arctoolbox-error/m-p/1203778#M58760</guid>
      <dc:creator>Brian_Wilson</dc:creator>
      <dc:date>2022-08-17T15:34:54Z</dc:date>
    </item>
  </channel>
</rss>

