<?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 arcpy - lyr in getparamter list in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-lyr-in-getparamter-list/m-p/1034727#M60321</link>
    <description>&lt;P&gt;I have a toolbox python script that still works in ArcMap - I am trying to updated to work in ArcPro&lt;/P&gt;&lt;P&gt;the script takes input parameters for&lt;/P&gt;&lt;P&gt;1 Site Boundary&lt;/P&gt;&lt;P&gt;2 Layers on Site (multiple layers)&lt;/P&gt;&lt;P&gt;3 Layers within distance of Site (multiple layers)&lt;/P&gt;&lt;P&gt;and writes to a text file summarizing layers and their visible fields that fall within or within distance of Site Boundary Feature.&lt;/P&gt;&lt;P&gt;where it seems to be not working in ArcPro is when it selects lyrs in the map from the input parameters. the script is completing without error messages because it is not recognizing any layers in the map that are in GetParameter inputs...&lt;/P&gt;&lt;P&gt;WithinLyrs = arcpy.GetParameter(1)&lt;/P&gt;&lt;P&gt;NearbyLyrs = arcpy.GetParameter(2)&lt;/P&gt;&lt;P&gt;dataF = aprx.activeMap&lt;/P&gt;&lt;P&gt;layers = dataF.listLayers()&lt;/P&gt;&lt;P&gt;lyrNum=0&lt;/P&gt;&lt;P&gt;for lyr in layers:&lt;/P&gt;&lt;P&gt;&amp;gt;if lyr.isFeatureLayer==1&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;if lyr in WithinLyrs or NearbyLyrs:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how is this handled differently in Pro vs Map?&lt;/P&gt;</description>
    <pubDate>Tue, 09 Mar 2021 22:23:32 GMT</pubDate>
    <dc:creator>DavidCook2</dc:creator>
    <dc:date>2021-03-09T22:23:32Z</dc:date>
    <item>
      <title>arcpy - lyr in getparamter list</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-lyr-in-getparamter-list/m-p/1034727#M60321</link>
      <description>&lt;P&gt;I have a toolbox python script that still works in ArcMap - I am trying to updated to work in ArcPro&lt;/P&gt;&lt;P&gt;the script takes input parameters for&lt;/P&gt;&lt;P&gt;1 Site Boundary&lt;/P&gt;&lt;P&gt;2 Layers on Site (multiple layers)&lt;/P&gt;&lt;P&gt;3 Layers within distance of Site (multiple layers)&lt;/P&gt;&lt;P&gt;and writes to a text file summarizing layers and their visible fields that fall within or within distance of Site Boundary Feature.&lt;/P&gt;&lt;P&gt;where it seems to be not working in ArcPro is when it selects lyrs in the map from the input parameters. the script is completing without error messages because it is not recognizing any layers in the map that are in GetParameter inputs...&lt;/P&gt;&lt;P&gt;WithinLyrs = arcpy.GetParameter(1)&lt;/P&gt;&lt;P&gt;NearbyLyrs = arcpy.GetParameter(2)&lt;/P&gt;&lt;P&gt;dataF = aprx.activeMap&lt;/P&gt;&lt;P&gt;layers = dataF.listLayers()&lt;/P&gt;&lt;P&gt;lyrNum=0&lt;/P&gt;&lt;P&gt;for lyr in layers:&lt;/P&gt;&lt;P&gt;&amp;gt;if lyr.isFeatureLayer==1&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;if lyr in WithinLyrs or NearbyLyrs:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how is this handled differently in Pro vs Map?&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 22:23:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-lyr-in-getparamter-list/m-p/1034727#M60321</guid>
      <dc:creator>DavidCook2</dc:creator>
      <dc:date>2021-03-09T22:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy - lyr in getparamter list</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-lyr-in-getparamter-list/m-p/1034747#M60322</link>
      <description>&lt;P&gt;did you try GetParameterAsText (you have others), and move the arcpy Current line up before the parameter list (shouldn't matter, but it might.&amp;nbsp; Your layer list should be populated with the values within the project as multivalue, direction input.&amp;nbsp; Using the python custom toolbox still allows you to work with a dialog and you can modify you parameters there as well&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 23:30:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-lyr-in-getparamter-list/m-p/1034747#M60322</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-03-09T23:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy - lyr in getparamter list</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-lyr-in-getparamter-list/m-p/1034913#M60323</link>
      <description>&lt;P&gt;Dan - thanks for the tips. GetParameterAsText and moving arcpy Current did not work - but the only reason why layers were being pulled from the map was to turn them on and make visible if they were in&amp;nbsp; the input selection. if all layers are being added to parameters as inputs from the map this is redundant and not needed. adjusted section to just look at input parameter variables.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 14:40:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-lyr-in-getparamter-list/m-p/1034913#M60323</guid>
      <dc:creator>DavidCook2</dc:creator>
      <dc:date>2021-03-10T14:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy - lyr in getparamter list</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-lyr-in-getparamter-list/m-p/1035239#M60331</link>
      <description>&lt;P&gt;thanks for the tips Dan!&lt;/P&gt;</description>
      <pubDate>Thu, 11 Mar 2021 00:26:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-lyr-in-getparamter-list/m-p/1035239#M60331</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-03-11T00:26:45Z</dc:date>
    </item>
  </channel>
</rss>

