<?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 Save path to gdb from GetParameterAsText in Python Snippets Questions</title>
    <link>https://community.esri.com/t5/python-snippets-questions/save-path-to-gdb-from-getparameterastext/m-p/833179#M429</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wrote a tool script using python that collects a couple of feature classes (from different Feature data sets in the same gdb) as several GetParameterAsText.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I now want to start editing I figured out that it requires to address the gdb and not the Feature data set (or the feature class). But all methods I found until now refer to the feature data set.&amp;nbsp;&lt;/P&gt;&lt;P&gt;like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_polygonfeature&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;or&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;dirname&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_polygonfeature&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Isn't there a way to call the gdb that contains the feature class/feature data set?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 10:04:51 GMT</pubDate>
    <dc:creator>Nicole_Ueberschär</dc:creator>
    <dc:date>2021-12-12T10:04:51Z</dc:date>
    <item>
      <title>Save path to gdb from GetParameterAsText</title>
      <link>https://community.esri.com/t5/python-snippets-questions/save-path-to-gdb-from-getparameterastext/m-p/833179#M429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wrote a tool script using python that collects a couple of feature classes (from different Feature data sets in the same gdb) as several GetParameterAsText.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I now want to start editing I figured out that it requires to address the gdb and not the Feature data set (or the feature class). But all methods I found until now refer to the feature data set.&amp;nbsp;&lt;/P&gt;&lt;P&gt;like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_polygonfeature&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;or&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;dirname&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_polygonfeature&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Isn't there a way to call the gdb that contains the feature class/feature data set?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:04:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/save-path-to-gdb-from-getparameterastext/m-p/833179#M429</guid>
      <dc:creator>Nicole_Ueberschär</dc:creator>
      <dc:date>2021-12-12T10:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: Save path to gdb from GetParameterAsText</title>
      <link>https://community.esri.com/t5/python-snippets-questions/save-path-to-gdb-from-getparameterastext/m-p/833180#M430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe there is arcpy method that does this but an easy way is to search the string for the .gdb.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;strTest &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"C:\WorkDoc\Default.gdb\myDataset\myFeatureClass"&lt;/SPAN&gt;
pathGDB &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; strTest&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;strTest&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;index&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'.gdb'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;‍‍
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; pathGDB‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:04:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/save-path-to-gdb-from-getparameterastext/m-p/833180#M430</guid>
      <dc:creator>KevinDunlop</dc:creator>
      <dc:date>2021-12-12T10:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: Save path to gdb from GetParameterAsText</title>
      <link>https://community.esri.com/t5/python-snippets-questions/save-path-to-gdb-from-getparameterastext/m-p/833181#M431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Kevin, this is at least a solution.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I still also believe that there must be an arcpy method...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2017 09:44:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/save-path-to-gdb-from-getparameterastext/m-p/833181#M431</guid>
      <dc:creator>Nicole_Ueberschär</dc:creator>
      <dc:date>2017-10-19T09:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: Save path to gdb from GetParameterAsText</title>
      <link>https://community.esri.com/t5/python-snippets-questions/save-path-to-gdb-from-getparameterastext/m-p/833182#M432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-functions/describe-object-properties.htm"&gt;&lt;STRONG&gt;catalogPath&lt;/STRONG&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2017 12:16:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/save-path-to-gdb-from-getparameterastext/m-p/833182#M432</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-10-19T12:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: Save path to gdb from GetParameterAsText</title>
      <link>https://community.esri.com/t5/python-snippets-questions/save-path-to-gdb-from-getparameterastext/m-p/833183#M433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the hint Dan, but for me the catalogPath gives the full path to the feature class and not only the gdb.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also baseName is giving the feature class (without the path).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Oct 2017 07:04:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/save-path-to-gdb-from-getparameterastext/m-p/833183#M433</guid>
      <dc:creator>Nicole_Ueberschär</dc:creator>
      <dc:date>2017-10-24T07:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: Save path to gdb from GetParameterAsText</title>
      <link>https://community.esri.com/t5/python-snippets-questions/save-path-to-gdb-from-getparameterastext/m-p/833184#M434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Slice and splice...&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;cp &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"C:\Git_Dan\a_Data\testdata.gdb\square2"&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN class="comment token"&gt;# ---- catalogPath result -----&lt;/SPAN&gt;

to_cp &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"\\"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;cp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"."&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"\\"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN class="comment token"&gt;#---- split, slice, split, slice&lt;/SPAN&gt;

to_cp
&lt;SPAN class="string token"&gt;'C:\\Git_Dan\\a_Data'&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:04:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/save-path-to-gdb-from-getparameterastext/m-p/833184#M434</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-12T10:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: Save path to gdb from GetParameterAsText</title>
      <link>https://community.esri.com/t5/python-snippets-questions/save-path-to-gdb-from-getparameterastext/m-p/833185#M435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, that goes in the same direction as Kevin's solution. I still think there must be a property somewhere storing the gdb automatically...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Oct 2017 08:14:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/save-path-to-gdb-from-getparameterastext/m-p/833185#M435</guid>
      <dc:creator>Nicole_Ueberschär</dc:creator>
      <dc:date>2017-10-24T08:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: Save path to gdb from GetParameterAsText</title>
      <link>https://community.esri.com/t5/python-snippets-questions/save-path-to-gdb-from-getparameterastext/m-p/833186#M436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;a gdb is essentially a folder, so 'os.path' isn't going to be much help either&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;cp = r"C:\Git_Dan\a_Data\testdata.gdb"&lt;/DIV&gt;&lt;DIV&gt;os.path.isdir(cp)&lt;/DIV&gt;&lt;DIV&gt;True&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Oct 2017 08:27:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/save-path-to-gdb-from-getparameterastext/m-p/833186#M436</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-10-24T08:27:46Z</dc:date>
    </item>
  </channel>
</rss>

