<?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 How to prompt for parameters within a loop? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-prompt-for-parameters-within-a-loop/m-p/265462#M20426</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to get multiple parameters (status, target_gdb,...) for each feature class within the Map. The number of feature classes is variable, so I can't set a specific number of parameters. I thought to call another python script (secondary_script) to:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;pass 3 values (a,b,c) from the original script to the secondary_script&lt;/LI&gt;&lt;LI&gt;get the parameters for each feature class (x,y)&lt;/LI&gt;&lt;LI&gt;return two parameters (x,y) from secondary_script to original_script.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've never done this before and it's not working, probably for various reasons, but the most basic is that the secondary_script is not prompting for the necessary parameters (x,y). Is there a way to do this, and if so, how? I also tried assigning the GetParameterAsText to (3) and (4), but that didn't work either. I'm at a loss.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Original script:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;import secondary_script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# call the secondary_script&lt;/P&gt;&lt;P&gt;secondary_script.module_name(a,b,c)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Secondary script:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;import arcpy, os&lt;BR /&gt;from original_script import a,b,c&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x = arcpy.GetParameterAsText(0)&lt;BR /&gt;y = arcpy.GetParameterAsText(1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;def copyLayerToGDB(a,b,c,x,y):&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Aug 2020 20:46:01 GMT</pubDate>
    <dc:creator>WhitneyWeber</dc:creator>
    <dc:date>2020-08-11T20:46:01Z</dc:date>
    <item>
      <title>How to prompt for parameters within a loop?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-prompt-for-parameters-within-a-loop/m-p/265462#M20426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to get multiple parameters (status, target_gdb,...) for each feature class within the Map. The number of feature classes is variable, so I can't set a specific number of parameters. I thought to call another python script (secondary_script) to:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;pass 3 values (a,b,c) from the original script to the secondary_script&lt;/LI&gt;&lt;LI&gt;get the parameters for each feature class (x,y)&lt;/LI&gt;&lt;LI&gt;return two parameters (x,y) from secondary_script to original_script.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've never done this before and it's not working, probably for various reasons, but the most basic is that the secondary_script is not prompting for the necessary parameters (x,y). Is there a way to do this, and if so, how? I also tried assigning the GetParameterAsText to (3) and (4), but that didn't work either. I'm at a loss.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Original script:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;import secondary_script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# call the secondary_script&lt;/P&gt;&lt;P&gt;secondary_script.module_name(a,b,c)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Secondary script:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;import arcpy, os&lt;BR /&gt;from original_script import a,b,c&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x = arcpy.GetParameterAsText(0)&lt;BR /&gt;y = arcpy.GetParameterAsText(1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;def copyLayerToGDB(a,b,c,x,y):&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Aug 2020 20:46:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-prompt-for-parameters-within-a-loop/m-p/265462#M20426</guid>
      <dc:creator>WhitneyWeber</dc:creator>
      <dc:date>2020-08-11T20:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to prompt for parameters within a loop?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-prompt-for-parameters-within-a-loop/m-p/265463#M20427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's very unclear to me what you're trying to do.&lt;/P&gt;&lt;P&gt;Dou you want to&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;get characteristics (visibility, data source, name, etc.) of all/some layers in the map?&lt;/LI&gt;&lt;LI&gt;set characteristics for all/some layers in the map?&lt;/LI&gt;&lt;LI&gt;do something else with those layers?&lt;/LI&gt;&lt;LI&gt;Do you need a graphical user interface?&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2020 08:01:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-prompt-for-parameters-within-a-loop/m-p/265463#M20427</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2020-08-17T08:01:41Z</dc:date>
    </item>
  </channel>
</rss>

