<?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: Select By Location in Script Errors in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/select-by-location-in-script-errors/m-p/204465#M15729</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;@ Ian, I think I solved your gdb quandary...please see your other thread....hope I explained to your satisfaction.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To clarify here, the issue is &lt;/SPAN&gt;&lt;SPAN style="text-decoration:underline;"&gt;not&lt;/SPAN&gt;&lt;SPAN&gt; the same, although you may argue it could be somewhat related.&amp;nbsp; The issue here raised is 'invalid input' (000368)....and your issues raised are 'invalid parameters' and 'in_features, parameter cannot be set' (000622 and 000628) - I think one tripped the other.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Oh, by the way, I made an error in the earlier script anyway - and I think your suspicions were well-founded about the lock...I'm still not fully satisfied I understand it, but the workaround is sound.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/111220-Error-on-Make-Feature-Layer-for-looping-over-selected-attributes#8"&gt;http://forums.arcgis.com/threads/111220-Error-on-Make-Feature-Layer-for-looping-over-selected-attributes#8&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Wayne&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 May 2014 21:56:54 GMT</pubDate>
    <dc:creator>T__WayneWhitley</dc:creator>
    <dc:date>2014-05-30T21:56:54Z</dc:date>
    <item>
      <title>Select By Location in Script Errors</title>
      <link>https://community.esri.com/t5/python-questions/select-by-location-in-script-errors/m-p/204461#M15725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have no idea why I can run this tool from tool dialogue but not from the following script?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Error Message: Failed to execute. Parameters are not valid. ERROR 000368: Invalid input data.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (SelectLayerByLocation).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy import os from arcpy import env env.overwriteOutput = 1 ''' lines = arcpy.GetParameterAsText(0) results = arcpy.GetParameterAsText(1) '''&amp;nbsp; lines = 'G:/Xcel/Route Tool/Southwest/Scratch.gdb/lines_clip' results = 'G:/Xcel/Route Tool/Southwest/Results.gdb'&amp;nbsp; line_string = '"' + "'" + lines + "'" + " #" + '"'&amp;nbsp; env.workspace = results&amp;nbsp; def main():&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; points = results + '\\pts' &amp;nbsp;&amp;nbsp;&amp;nbsp; # Process: Find all stream crossings (points) &amp;nbsp;&amp;nbsp;&amp;nbsp; #arcpy.Intersect_analysis(lines,'G:\Xcel\Route Tool\Southwest\Results.gdb\pts',"ONLY_FID","#","POINT")&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; in_features = "'" + lines + "'" + " #"&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Intersect_analysis(in_features,\ &amp;nbsp;&amp;nbsp;&amp;nbsp; out_feature_class="G:/Xcel/Route Tool/Southwest/Scratch.gdb/lines_clip_Intersect",\ &amp;nbsp;&amp;nbsp;&amp;nbsp; join_attributes="ONLY_FID",cluster_tolerance="#",output_type="POINT")&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; # Adds x and y field to points &amp;nbsp;&amp;nbsp;&amp;nbsp; pts_geometry = arcpy.AddXY_management("G:/Xcel/Route Tool/Southwest/Scratch.gdb/lines_clip_Intersect")&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; # Dissolves duplicate points &amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Dissolve_management(pts_geometry,"pts_dissolve","POINT_X;POINT_Y","#","SINGLE_PART","DISSOLVE_LINES")&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; # Replace a layer/table view name with a path to a dataset (which can be a layer file) or create the layer/table view within the script &amp;nbsp;&amp;nbsp;&amp;nbsp; # The following inputs are layers or table views: "pts_dissolve", "LCP_A" &amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SelectLayerByLocation_management("pts_dissolve","INTERSECT","LCP_A","400 Feet","ADD_TO_SELECTION")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2014 14:29:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-by-location-in-script-errors/m-p/204461#M15725</guid>
      <dc:creator>NoahHuntington</dc:creator>
      <dc:date>2014-05-30T14:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: Select By Location in Script Errors</title>
      <link>https://community.esri.com/t5/python-questions/select-by-location-in-script-errors/m-p/204462#M15726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I know right?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was having the same issue with gdb feature classes in doing something similar on this&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://forums.arcgis.com/threads/111220-Error-on-Make-Feature-Layer-for-looping-over-selected-attributes" rel="nofollow" target="_blank"&gt; thread &lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I had to end up running my script in the interactive python window in ArcGIS on the shapefiles I brought into my map that I made converted from gdb feature classes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Perhaps making a feature layer first from your feature classes then running the select by location tool would work better?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2014 14:57:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-by-location-in-script-errors/m-p/204462#M15726</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2014-05-30T14:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: Select By Location in Script Errors</title>
      <link>https://community.esri.com/t5/python-questions/select-by-location-in-script-errors/m-p/204463#M15727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;pts_dissolve has to be a feature layer&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2014 15:06:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-by-location-in-script-errors/m-p/204463#M15727</guid>
      <dc:creator>BenSciance</dc:creator>
      <dc:date>2014-05-30T15:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: Select By Location in Script Errors</title>
      <link>https://community.esri.com/t5/python-questions/select-by-location-in-script-errors/m-p/204464#M15728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Making a feature layer before selection corrected my issue. Thank you both! I would probably save a lot of time by reading the resources first.&amp;nbsp; Glad to know I wasn't the only one out there making this mistake. Lol.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2014 15:24:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-by-location-in-script-errors/m-p/204464#M15728</guid>
      <dc:creator>NoahHuntington</dc:creator>
      <dc:date>2014-05-30T15:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: Select By Location in Script Errors</title>
      <link>https://community.esri.com/t5/python-questions/select-by-location-in-script-errors/m-p/204465#M15729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;@ Ian, I think I solved your gdb quandary...please see your other thread....hope I explained to your satisfaction.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To clarify here, the issue is &lt;/SPAN&gt;&lt;SPAN style="text-decoration:underline;"&gt;not&lt;/SPAN&gt;&lt;SPAN&gt; the same, although you may argue it could be somewhat related.&amp;nbsp; The issue here raised is 'invalid input' (000368)....and your issues raised are 'invalid parameters' and 'in_features, parameter cannot be set' (000622 and 000628) - I think one tripped the other.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Oh, by the way, I made an error in the earlier script anyway - and I think your suspicions were well-founded about the lock...I'm still not fully satisfied I understand it, but the workaround is sound.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/111220-Error-on-Make-Feature-Layer-for-looping-over-selected-attributes#8"&gt;http://forums.arcgis.com/threads/111220-Error-on-Make-Feature-Layer-for-looping-over-selected-attributes#8&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Wayne&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2014 21:56:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-by-location-in-script-errors/m-p/204465#M15729</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2014-05-30T21:56:54Z</dc:date>
    </item>
  </channel>
</rss>

