<?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 feature class with checkbox arcpy in ArcAPI Questions</title>
    <link>https://community.esri.com/t5/arcapi-questions/select-feature-class-with-checkbox-arcpy/m-p/827313#M68</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Leandro,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are running this tool from inside ArcGIS Desktop or Pro you can take advantage of the ArcGIS geoprocessing setup, which saves you a LOT (A LOT) of effort, and the users of your tool see the tool interface they are used to with other ArcGIS tools. &amp;nbsp;The examples in the help are for that environment, not the one you are cobbling together using TkInter. &amp;nbsp;Don't know if you're going to get a lot of help with the code using your alternative approach, which I don't personally recommend.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can generate a pick list in either environment by getting a list of names using arcpy.ListFeatureClasses() and loading them into a list of strings, which in TkInter you'd load into an object in your custom form (you're outside my knowledge base), or if using the ArcGIS geoprocessing environment into a string parameter with a filter listing the filename strings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to post code, recommend using geonet formatting: &lt;A href="https://community.esri.com/people/curtvprice/blog/2014/09/25/posting-code-blocks-in-the-new-geonet?sr=search&amp;amp;searchId=05542030-81b2-446a-b4d9-ce92480cb7a2&amp;amp;searchIndex=4"&gt;https://community.esri.com/people/curtvprice/blog/2014/09/25/posting-code-blocks-in-the-new-geonet?sr=search&amp;amp;searchId=05542030-81b2-446a-b4d9-ce92480cb7a2&amp;amp;searchIndex=4&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Sep 2017 22:49:42 GMT</pubDate>
    <dc:creator>curtvprice</dc:creator>
    <dc:date>2017-09-05T22:49:42Z</dc:date>
    <item>
      <title>select feature class with checkbox arcpy</title>
      <link>https://community.esri.com/t5/arcapi-questions/select-feature-class-with-checkbox-arcpy/m-p/827310#M65</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How to&amp;nbsp;select feature class with checkbox arcpy ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Sep 2017 20:03:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcapi-questions/select-feature-class-with-checkbox-arcpy/m-p/827310#M65</guid>
      <dc:creator>leandrofernandes</dc:creator>
      <dc:date>2017-09-04T20:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: select feature class with checkbox arcpy</title>
      <link>https://community.esri.com/t5/arcapi-questions/select-feature-class-with-checkbox-arcpy/m-p/827311#M66</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you mean &lt;EM&gt;picklist&lt;/EM&gt;, not checkbox, this is done in the tool parameter properties(.tbx) or in Python code (.pyt) using a filter. Layer parameters look at the currently open ArcMap session to create a list of map layers you can pick from.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/analyze/creating-tools/setting-script-tool-parameters.htm" title="http://desktop.arcgis.com/en/arcmap/latest/analyze/creating-tools/setting-script-tool-parameters.htm"&gt;Setting script tool parameters—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/analyze/creating-tools/defining-parameters-in-a-python-toolbox.htm" title="http://desktop.arcgis.com/en/arcmap/latest/analyze/creating-tools/defining-parameters-in-a-python-toolbox.htm"&gt;Defining parameters in a Python toolbox—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Sep 2017 21:23:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcapi-questions/select-feature-class-with-checkbox-arcpy/m-p/827311#M66</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2017-09-04T21:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: select feature class with checkbox arcpy</title>
      <link>https://community.esri.com/t5/arcapi-questions/select-feature-class-with-checkbox-arcpy/m-p/827312#M67</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, I started with arcpy yesterday and I do not understand.&lt;/P&gt;&lt;P&gt;I have a .gdb and I would like to select some feature class to load in SQL Server, but not all.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;import arcpy&lt;BR /&gt;from Tkinter import *&lt;/P&gt;&lt;P&gt;root = Tk()&lt;BR /&gt;features = []&lt;/P&gt;&lt;P&gt;def var_states():&lt;BR /&gt; print 'Upload data SQL ?????'&lt;/P&gt;&lt;P&gt;arcpy.env.workspace = "D:\GIS\Treinamento\deletar.gdb"&lt;/P&gt;&lt;P&gt;datasets = arcpy.ListDatasets(feature_type='feature')&lt;BR /&gt;datasets = [''] + datasets if datasets is not None else []&lt;BR /&gt;i = 1&lt;/P&gt;&lt;P&gt;Label(root, text="Select Features Class: ").grid(row=0, sticky=W)&lt;/P&gt;&lt;P&gt;for ds in datasets:&lt;BR /&gt; for fc in arcpy.ListFeatureClasses(feature_dataset=ds):&lt;BR /&gt; var = IntVar()&lt;BR /&gt; desc = arcpy.Describe(fc)&lt;BR /&gt; chk = Checkbutton(root, text=desc.name, variable=var).grid(row=i, padx = 20 , sticky=W)&lt;BR /&gt; features.append(fc)&lt;BR /&gt; i = i + 1&lt;/P&gt;&lt;P&gt;Label(root, text="").grid(row=i, sticky=W)&lt;BR /&gt;i = i+1&lt;BR /&gt;button = Button(root, text='OK', command=var_states)&lt;BR /&gt;button.grid(row=i+1, sticky=W)&lt;BR /&gt;button.place(relx=0.5, rely=0.9, anchor=CENTER)&lt;BR /&gt;i = i+1&lt;/P&gt;&lt;P&gt;w = 350&lt;BR /&gt;h = i * 22&lt;BR /&gt;ws = root.winfo_screenwidth() # width of the screen&lt;BR /&gt;hs = root.winfo_screenheight() # height of the screen&lt;BR /&gt;x = (ws/2) - (w/2)&lt;BR /&gt;y = (hs/2) - (h/2)&lt;BR /&gt;root.geometry('%dx%d+%d+%d' % (w, h, x, y))&lt;/P&gt;&lt;P&gt;root.mainloop()&lt;/P&gt;&lt;P&gt;#print map((lambda var: var.get()), states)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I do not know how to find the features class chosen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have an example that I can use?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Sep 2017 12:58:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcapi-questions/select-feature-class-with-checkbox-arcpy/m-p/827312#M67</guid>
      <dc:creator>leandrofernandes</dc:creator>
      <dc:date>2017-09-05T12:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: select feature class with checkbox arcpy</title>
      <link>https://community.esri.com/t5/arcapi-questions/select-feature-class-with-checkbox-arcpy/m-p/827313#M68</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Leandro,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are running this tool from inside ArcGIS Desktop or Pro you can take advantage of the ArcGIS geoprocessing setup, which saves you a LOT (A LOT) of effort, and the users of your tool see the tool interface they are used to with other ArcGIS tools. &amp;nbsp;The examples in the help are for that environment, not the one you are cobbling together using TkInter. &amp;nbsp;Don't know if you're going to get a lot of help with the code using your alternative approach, which I don't personally recommend.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can generate a pick list in either environment by getting a list of names using arcpy.ListFeatureClasses() and loading them into a list of strings, which in TkInter you'd load into an object in your custom form (you're outside my knowledge base), or if using the ArcGIS geoprocessing environment into a string parameter with a filter listing the filename strings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to post code, recommend using geonet formatting: &lt;A href="https://community.esri.com/people/curtvprice/blog/2014/09/25/posting-code-blocks-in-the-new-geonet?sr=search&amp;amp;searchId=05542030-81b2-446a-b4d9-ce92480cb7a2&amp;amp;searchIndex=4"&gt;https://community.esri.com/people/curtvprice/blog/2014/09/25/posting-code-blocks-in-the-new-geonet?sr=search&amp;amp;searchId=05542030-81b2-446a-b4d9-ce92480cb7a2&amp;amp;searchIndex=4&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Sep 2017 22:49:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcapi-questions/select-feature-class-with-checkbox-arcpy/m-p/827313#M68</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2017-09-05T22:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: select feature class with checkbox arcpy</title>
      <link>https://community.esri.com/t5/arcapi-questions/select-feature-class-with-checkbox-arcpy/m-p/827314#M69</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Sep 2017 18:34:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcapi-questions/select-feature-class-with-checkbox-arcpy/m-p/827314#M69</guid>
      <dc:creator>leandrofernandes</dc:creator>
      <dc:date>2017-09-06T18:34:43Z</dc:date>
    </item>
  </channel>
</rss>

