<?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: Pass list of feature class to union in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/pass-list-of-feature-class-to-union/m-p/1088660#M62078</link>
    <description>&lt;P&gt;Ha ha your right, I guess I was over thinking it.&lt;/P&gt;</description>
    <pubDate>Thu, 12 Aug 2021 21:23:06 GMT</pubDate>
    <dc:creator>2Quiker</dc:creator>
    <dc:date>2021-08-12T21:23:06Z</dc:date>
    <item>
      <title>Pass list of feature class to union</title>
      <link>https://community.esri.com/t5/python-questions/pass-list-of-feature-class-to-union/m-p/1088619#M62073</link>
      <description>&lt;P&gt;I need to spatial join only certain feature class with specific names but I am not sure how to pass the list of feature class on arcpy.ListFeatureClasses. There is about 10 feature classes in the geodatabase but like I said just need certain ones.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy
from arcpy import env

env.workspace = r"C:\Temp\Default2.gdb"
env.overwriteOutput=True

#arcpy.CreateFileGDB_management(r"C:\Temp\Test", "test_6.gdb")
lst = ["Wetlands","Current_Panels"] # this is where I was trying to list the spcifice feature classes I need from the geodatabase.
fclist = arcpy.ListFeatureClasses(lst, "polygon")

for fc in fclist:
    print (fc)
    #fcdesc = arcpy.Describe(fc)
#print (fc)
#arcpy.Union_analysis(fc, "C:\Temp\Test\test_6.gdb")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2021 20:03:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pass-list-of-feature-class-to-union/m-p/1088619#M62073</guid>
      <dc:creator>2Quiker</dc:creator>
      <dc:date>2021-08-12T20:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: Pass list of feature class to union</title>
      <link>https://community.esri.com/t5/python-questions/pass-list-of-feature-class-to-union/m-p/1088622#M62074</link>
      <description>&lt;P&gt;You can use a little list comprehension:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;lst = [fc for fc in arcpy.ListFeatureClasses('', 'polygon') if fc in ["Wetlands", "Current_Panels", ....]]&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 12 Aug 2021 20:08:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pass-list-of-feature-class-to-union/m-p/1088622#M62074</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-08-12T20:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: Pass list of feature class to union</title>
      <link>https://community.esri.com/t5/python-questions/pass-list-of-feature-class-to-union/m-p/1088625#M62075</link>
      <description>&lt;P&gt;You want to use the &lt;A title="walk" href="https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/walk.htm" target="_blank" rel="noopener"&gt;walk&lt;/A&gt; method on top of using the os.path.split method if you want to utilize a list of feature classes using python.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy

walk = arcpy.da.Walk(workspace, datatype="FeatureClass")

for dirpath, dirnames, filenames in walk:
    for filename in filenames:
        fcs.append(os.path.join(dirpath, filename))

for fc in fcs:
    #Get feature class name
    fcsname = os.path.basename(fc)
    name = os.path.splitext(fcsname)
    y = name[1].lstrip('.')
    #print y
    if name in A_list:#your list
        #do something&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2021 20:13:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pass-list-of-feature-class-to-union/m-p/1088625#M62075</guid>
      <dc:creator>RPGIS</dc:creator>
      <dc:date>2021-08-12T20:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: Pass list of feature class to union</title>
      <link>https://community.esri.com/t5/python-questions/pass-list-of-feature-class-to-union/m-p/1088628#M62076</link>
      <description>&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/listfeatureclasses.htm" target="_blank"&gt;ListFeatureClasses—ArcGIS Pro | Documentation&lt;/A&gt; does not accept a list as input.&amp;nbsp; The first parameter is a string representing a wild card, which would work for you if there was a common naming element you could use with a wildcard.&amp;nbsp; To the best of my knowledge, the wildcard does not support regular expressions.&lt;/P&gt;&lt;P&gt;If you already have specific names of the feature classes, why use ListFeatureClasses at all?&amp;nbsp; Even if ListFeatureClasses supported passing a list, if you are not using wildcards then the list returned would simply be the list you passed in the first place, i.e., your fclist would be the same as lst.&amp;nbsp; (ListFeatureClasses doesn't actually return feature classes, it returns a list of strings of the names of feature classes)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2021 20:16:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pass-list-of-feature-class-to-union/m-p/1088628#M62076</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-08-12T20:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: Pass list of feature class to union</title>
      <link>https://community.esri.com/t5/python-questions/pass-list-of-feature-class-to-union/m-p/1088660#M62078</link>
      <description>&lt;P&gt;Ha ha your right, I guess I was over thinking it.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2021 21:23:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pass-list-of-feature-class-to-union/m-p/1088660#M62078</guid>
      <dc:creator>2Quiker</dc:creator>
      <dc:date>2021-08-12T21:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: Pass list of feature class to union</title>
      <link>https://community.esri.com/t5/python-questions/pass-list-of-feature-class-to-union/m-p/1088716#M62081</link>
      <description>&lt;P&gt;I think this should be marked as the solution. I made my suggestion with the thinking of expanded wildcarding in case there wasn't a singular similarity in each fc name that you needed to filter for. And my post could have been more accurate as well so its not checking the full fc name against the fc name list which would need the complete fc names anyway to be true.&amp;nbsp; I think it would look like this for wildcarding against the fc name:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;lst = [fc for fc in arcpy.ListFEatureClasses('', 'polygon') if any(['a' in fc, 'b' in fc, 'c' in fc])]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Aug 2021 00:33:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pass-list-of-feature-class-to-union/m-p/1088716#M62081</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-08-13T00:33:53Z</dc:date>
    </item>
  </channel>
</rss>

