<?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 access feature class properties through ValueTable? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/access-feature-class-properties-through-valuetable/m-p/471130#M36760</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm working on a script that basically does one simple thing, append a bunch of feature classes in one geodatabase to corresponding fc's in another geodatabase (there's more to it, but there's no problem with that path of the script).&amp;nbsp; I'm creating a log file to record the results, and there's something I want to do, but I just don't think it'll work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As parameters for the tool, I have only the target geodatabase, and then a multivalue input for all of the feature classes.&amp;nbsp; In the script, the latter parameter comes in as a ValueTable, and I'm able to do what I need by accessing the feature classes with a while loop.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, I'm hoping to be able to take the first feature class, and work backward to automatically locate my newly created logfile in the folder that holds the original geodatabase.&amp;nbsp; I struggled with this for a while, and found that the problem is that the values in the ValueTable to do not have paths.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've looked for a way of finding the containing folder/workspace of a feature class, but have come up short.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas?&amp;nbsp; Of course I can add a parameter that can just be filled in with a folder path, but I'd prefer to automate this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Adam&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Jan 2013 21:25:00 GMT</pubDate>
    <dc:creator>AdamCox1</dc:creator>
    <dc:date>2013-01-14T21:25:00Z</dc:date>
    <item>
      <title>access feature class properties through ValueTable?</title>
      <link>https://community.esri.com/t5/python-questions/access-feature-class-properties-through-valuetable/m-p/471130#M36760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm working on a script that basically does one simple thing, append a bunch of feature classes in one geodatabase to corresponding fc's in another geodatabase (there's more to it, but there's no problem with that path of the script).&amp;nbsp; I'm creating a log file to record the results, and there's something I want to do, but I just don't think it'll work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As parameters for the tool, I have only the target geodatabase, and then a multivalue input for all of the feature classes.&amp;nbsp; In the script, the latter parameter comes in as a ValueTable, and I'm able to do what I need by accessing the feature classes with a while loop.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, I'm hoping to be able to take the first feature class, and work backward to automatically locate my newly created logfile in the folder that holds the original geodatabase.&amp;nbsp; I struggled with this for a while, and found that the problem is that the values in the ValueTable to do not have paths.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've looked for a way of finding the containing folder/workspace of a feature class, but have come up short.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas?&amp;nbsp; Of course I can add a parameter that can just be filled in with a folder path, but I'd prefer to automate this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Adam&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2013 21:25:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/access-feature-class-properties-through-valuetable/m-p/471130#M36760</guid>
      <dc:creator>AdamCox1</dc:creator>
      <dc:date>2013-01-14T21:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: access feature class properties through ValueTable?</title>
      <link>https://community.esri.com/t5/python-questions/access-feature-class-properties-through-valuetable/m-p/471131#M36761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Just thought I'd update this because I've long since fixed this issue.&amp;nbsp; In 10.0, multiple input parameters create ValueTables, though I've recently upgraded to 10.1 and found that lists are created in that version.&amp;nbsp; So this only applies to 10.0.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To access the feature classes in the ValueTable, I use the following code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy

#the following workspace parameter holds the path to the geodatabase
gdb_path = GetParameterAsText(0)

#with the toolvalidator script, the following multivalue string parameter is
#automatically populated with the names of each feature class in the above
#geodatabase. that way the user can select specific feature classes.
#use GetParameter to acquire it as a ValueTable
fc_list = GetParameter(1)

x = 0
while x &amp;lt; fc_list.rowCount:
&amp;nbsp;&amp;nbsp;&amp;nbsp; fc_name = fc_list.getTrueValue(x, 0)
&amp;nbsp;&amp;nbsp;&amp;nbsp; fc = gdb_path + os.sep + fc_name
&amp;nbsp;&amp;nbsp;&amp;nbsp; #do something
&amp;nbsp;&amp;nbsp;&amp;nbsp; x+=1
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:51:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/access-feature-class-properties-through-valuetable/m-p/471131#M36761</guid>
      <dc:creator>AdamCox1</dc:creator>
      <dc:date>2021-12-11T20:51:05Z</dc:date>
    </item>
  </channel>
</rss>

