Describe.catalogPath strange results

1492
1
10-11-2012 09:21 AM
DanielDillard
New Contributor II
I have a script tool that takes a workspace as a parameter, then loops through the tables in that workspace and prints their catalog path.

import arcpy
from arcpy import env

workspace = arcpy.GetParameterAsText(0)

env.workspace = workspace

for fc in sorted(arcpy.ListTables()):
 arcpy.AddMessage(arcpy.Describe(fc).catalogPath)


I have a file geodatabase with a schema imported from an SDE via XML.  When I run my script tool against this file gdb I get strange results.  The catalog path prints correctly for most of the tables, but a few will show having different catalog paths.  Is this a python thing, an environment thing, or an XML schema document thing?
Tags (2)
0 Kudos
1 Reply
DanielDillard
New Contributor II
Follow up:

I was running my script tool in ArcMap.  The tables that were showing a deviant catalog path were tables in the ArcMap TOC that were copies of the tables in my target workspace (same name, different workspace.  Ex: the target workspace is a File GDB with a table called STUDY_INFO, and the table in ArcMap is STUDY_INFO.dbf in a folder containing .dbf tables as well as shapefiles.)  If I removed the table from ArcMap, the tool listed the correct path.  This is kind of annoying, as the tool parameter is a workspace path and has nothing to do with the ArcMap TOC.
0 Kudos