<?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: Python problem: How to get workspace of a FeatureLayer? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/python-problem-how-to-get-workspace-of-a/m-p/719979#M19182</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Joe,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry to bang on about this but I looked at the Help page you identified, a page I have looked at before but I see NO mention of the property (thanks for correcting me) &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;Path&lt;/SPAN&gt;&lt;SPAN&gt;.&amp;nbsp; There is the property &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;CatalogPath&lt;/SPAN&gt;&lt;SPAN&gt; which you use on a dataset object but this actually returns something slightly different (with a shapefile). So where did you find out about the property &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;Path&lt;/SPAN&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Dec 2010 20:14:03 GMT</pubDate>
    <dc:creator>DuncanHornby</dc:creator>
    <dc:date>2010-12-09T20:14:03Z</dc:date>
    <item>
      <title>Python problem: How to get workspace of a FeatureLayer?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/python-problem-how-to-get-workspace-of-a/m-p/719975#M19178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Python Gurus,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As you all know there is the annoying problem of SQL syntax between different storage formats, by this I mean for a Personal Geodatabase a field is enclosed in [] whilst a file geodatabase has fields enclosed in "".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've recently became aware of a useful method of the geoprocessor &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;AddFieldDelimiters&lt;/SPAN&gt;&lt;SPAN&gt; that automates the correct enclosure based upon a workspace requirements. The Object Model diagram shows that the syntax is &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;gp.AddfieldDelimiters(fieldname,workspace)&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now I often expose my scripts as tools within ArcToolbox so my input parameters are usually a FeatureLayer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My problem is that having looked at the Object Model I can't work out how one gets a handle on the Workspace of a FeatureLayer which I could then use to feed into the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;AddfieldDelimiters&lt;/SPAN&gt;&lt;SPAN&gt; method for building the correct SQL syntax.&amp;nbsp; I thought the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;Describe&lt;/SPAN&gt;&lt;SPAN&gt; method would help with this but it seems it is not possible.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I want to avoid is the user having to select not only the FeatureLayer but then navigate to it's Workspace in the ArcToolbox interface.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So my question is simply how does one get the workspace of a featurelayer using the geoprocessor in Python? I am using ArcGIS 9.3.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Dec 2010 09:46:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/python-problem-how-to-get-workspace-of-a/m-p/719975#M19178</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2010-12-08T09:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: Python problem: How to get workspace of a FeatureLayer?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/python-problem-how-to-get-workspace-of-a/m-p/719976#M19179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Given a feature layer, your Python code could use Describe to find the path of the underlying data, and then parse that to determine if it's a file GDB, personal GDB, or something else.&amp;nbsp; Kind of like the following.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# Import system modules
import sys, string, os, arcgisscripting

# Create the Geoprocessor object
gp = arcgisscripting.create()

# Script arguments...
ftrLyr = sys.argv[1]
if ftrLyr == '#':
&amp;nbsp;&amp;nbsp; gp.AddError("&amp;nbsp; You must provide a feature layer.")

# Check to see if the input exists
if gp.Exists(ftrLyr):
&amp;nbsp;&amp;nbsp; desc = gp.Describe(ftrLyr)
&amp;nbsp;&amp;nbsp; ftrPath = desc.Path
&amp;nbsp;&amp;nbsp; ext = ftrPath.rpartition('.')[2]&amp;nbsp;&amp;nbsp; # Get part after last period.
&amp;nbsp;&amp;nbsp; ext = ext.lower()
&amp;nbsp;&amp;nbsp; if ext == "gdb":
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddMessage(" Workspace is file geodatabase")
&amp;nbsp;&amp;nbsp; elif ext == "mdb":
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddMessage(" Workspace is personal geodatabase")
&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddMessage(" Workspace is directory based (shapefile, coverage, etc.)")
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Incidentally, you might get some better responses if you asked this question over in the Python forum or the Geoprocessing forum.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 06:48:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/python-problem-how-to-get-workspace-of-a/m-p/719976#M19179</guid>
      <dc:creator>JoeVondracek</dc:creator>
      <dc:date>2021-12-12T06:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: Python problem: How to get workspace of a FeatureLayer?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/python-problem-how-to-get-workspace-of-a/m-p/719977#M19180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thats a good way of determining the workspace, but my question is where is the method &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;Path&lt;/SPAN&gt;&lt;SPAN&gt; documented in the Desktop help file? I find no mention of this method in the help file or object model!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I get your point about placing this question in the other thread but I've always considered that to be about processing not annoying specifics of Python!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Dec 2010 07:36:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/python-problem-how-to-get-workspace-of-a/m-p/719977#M19180</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2010-12-09T07:36:47Z</dc:date>
    </item>
    <item>
      <title>Re: Python problem: How to get workspace of a FeatureLayer?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/python-problem-how-to-get-workspace-of-a/m-p/719978#M19181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you open ArcGIS Desktop Help and go to the Contents tab, you can find information about the Describe object and its properties under the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Geoprocessing -&amp;gt; Automating your work with scripts -&amp;gt; Data properties and access when scripting -&amp;gt; Describing data&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The Geoprocessor Programming Model can be found as a PDF on your system at:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;C:\Program Files\ArcGIS\Documentation\Geoprocessor_93.pdf&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;Path&lt;/SPAN&gt;&lt;SPAN&gt; is a property, not a method.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Dec 2010 13:00:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/python-problem-how-to-get-workspace-of-a/m-p/719978#M19181</guid>
      <dc:creator>JoeVondracek</dc:creator>
      <dc:date>2010-12-09T13:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: Python problem: How to get workspace of a FeatureLayer?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/python-problem-how-to-get-workspace-of-a/m-p/719979#M19182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Joe,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry to bang on about this but I looked at the Help page you identified, a page I have looked at before but I see NO mention of the property (thanks for correcting me) &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;Path&lt;/SPAN&gt;&lt;SPAN&gt;.&amp;nbsp; There is the property &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;CatalogPath&lt;/SPAN&gt;&lt;SPAN&gt; which you use on a dataset object but this actually returns something slightly different (with a shapefile). So where did you find out about the property &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;Path&lt;/SPAN&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Dec 2010 20:14:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/python-problem-how-to-get-workspace-of-a/m-p/719979#M19182</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2010-12-09T20:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: Python problem: How to get workspace of a FeatureLayer?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/python-problem-how-to-get-workspace-of-a/m-p/719980#M19183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Well, here is the online version of the ArcGIS Desktop 9.3 Help:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Describing_data"&gt;http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Describing_data&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;On that page, under &lt;/SPAN&gt;&lt;STRONG&gt;Describe Object properties&lt;/STRONG&gt;&lt;SPAN&gt;, is a graphic that shows the properties for the Describe object.&amp;nbsp; The Path property is the last one listed in the graphic.&amp;nbsp; Beneath that graphic is a table that lists all of the properties with a short description.&amp;nbsp; The Path property is the last one in that table.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, you can look at this page, which should also be in your local Help:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Describe_Object_property"&gt;http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Describe_Object_property&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My installed Help documentation matches what is on the website.&amp;nbsp; However, I am running ArcGIS 9.3.1, and I see that both of these Help pages say that they were updated for 9.3.1.&amp;nbsp; Maybe the 9.3 versions of these pages didn't include the Path property.&amp;nbsp; Are you able to reference that property of the Describe object in your scripts?&amp;nbsp; If you can, then I would expect it to appear in your Help documentation.&amp;nbsp; If not, then this is all moot, eh?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Dec 2010 20:57:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/python-problem-how-to-get-workspace-of-a/m-p/719980#M19183</guid>
      <dc:creator>JoeVondracek</dc:creator>
      <dc:date>2010-12-09T20:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: Python problem: How to get workspace of a FeatureLayer?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/python-problem-how-to-get-workspace-of-a/m-p/719981#M19184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Joe,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Finally! I'm always telling people to RTFM and I practise what I preach but it seems the 9.3 desktop help is not the same as the 9.3 &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;online&lt;/SPAN&gt;&lt;SPAN&gt; desktop help. I note it says on that page (despite it saying 9.3 Help) that it has been update for 9.3.1 and there bold as brass is that property &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;Path&lt;/SPAN&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There are a load of other properties too I never knew the describe object could do, this is very frustrating.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The sooner they give up on python and go back to VBA the better! &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Dec 2010 21:37:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/python-problem-how-to-get-workspace-of-a/m-p/719981#M19184</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2010-12-09T21:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: Python problem: How to get workspace of a FeatureLayer?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/python-problem-how-to-get-workspace-of-a/m-p/719982#M19185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You might also want to check the Geoprocessor Programming Model PDF on your system to see if it shows the "extra" properties or not:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;C:\Program Files\ArcGIS\Documentation\Geoprocessor_93.pdf&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Dec 2010 22:45:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/python-problem-how-to-get-workspace-of-a/m-p/719982#M19185</guid>
      <dc:creator>JoeVondracek</dc:creator>
      <dc:date>2010-12-09T22:45:17Z</dc:date>
    </item>
  </channel>
</rss>

