replaceDataSource not renaming table view layer name (ArcGIS 10.0)

406
4
Jump to solution
08-06-2012 11:58 AM
KyleSchutt
New Contributor
Hello All,

We are trying to update the data source of a broken Table View layer in an MXD. On one machine the layer name is renamed to the dataset name in the new workspace. However, other machines we have tested on do not change the layer's name to the new dataset name.

        table = arcpy.mapping.ListTableViews(mxd, "", df)[0]         table.replaceDataSource(county_fgdb, "FILEGDB_WORKSPACE", countyname, True)


We have tried using the "name" property on the TableView object:
table.name = countyname

But, we are met with the following error:
StandaloneTableObject: Set attribute name does not exist.


We have checked the TableView API in 10.0 (http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/TableView/00s300000017000000/) and it states that "name" is read/write.

It is also strange that it states that it is a StandaloneTableObject instead of TableView.

Does anyone have an idea about this issue? If more information is needed, please let me know.

Thanks
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
JeffBarrette
Esri Regular Contributor
This was confirmed as a bug (NIM083567) and will be addressed for 10.1 SP1.

Thanks again,
Jeff

View solution in original post

0 Kudos
4 Replies
JeffBarrette
Esri Regular Contributor
I can reproduce the issue.  Name should be r/w just like for layers.  You said it works on some machines?

If a bug, we'll address in a SP.

Thanks!
Jeff
0 Kudos
JeffBarrette
Esri Regular Contributor
This was confirmed as a bug (NIM083567) and will be addressed for 10.1 SP1.

Thanks again,
Jeff
0 Kudos
KyleSchutt
New Contributor
Thanks for the reply.

The "lyr.name" does not work on any machines as we are using 10.0. But the "replaceDataSource" does not work consistently between different builds of 10.0.

When we execute the script on a machine with the following credentials, the "replaceDataSource" function renames the Standalone Table to the dataSet name that we passed.

ESRI ArcCatalog 10.0 (Build 2414)
License: ArcInfo

However, when we execute the same script on machines the following credentials, the "replaceDataSource" function does NOT rename the Standalone Table to the dataSet name that we passed. The name remains the same as the original Standalone Table name from the MXD.

ESRI ArcCatalog 10.0 (Build 3200)
ArcGIS Desktop 10 Service Pack 2
License: ArcInfo
-or-
ESRI ArcCatalog 10.0 (Build 4000)
ArcGIS Desktop 10 Service Pack 4
License: ArcInfo



Do you have link to that bug report?

Thanks.
0 Kudos
JeffBarrette
Esri Regular Contributor
NIM083567 should address this issue at 10.1 SP1. 

ReplaceDataSource should NOT rename table layer names in the TOC (it doesn't do this for standard layers).  It should simply replace the data source and it is up to you is you want the name to be changed. 

table.name = "something" is all you would need to do after the fix is in place.

Thanks again for reporting this,
Jeff
0 Kudos