POST
|
Hi zenben, Thanks for your reply. But unfortunately it's not exactly what I am looking for. If you have a look at the attachments maybe you see what I mean. SDEConnections is a screenshot of my connections the way they are listed under the "Documents and Settings" App folder. Those are the same names as in my ArcCatalog connection seen in the CatalogConnection Screenshot. To reference to your SDE connections in a python script you can either use the path to your documents and settings folder or you can say Database Connections/Your Connection.sde. But when I referenced to either, Database Connections/Technical Data.sde or any other connection shown in the attachment it would give me an error. So I listed the workspaces with a python tool: for lyr in arcpy.mapping.ListLayers(mxd): if lyr.supports("WORKSPACEPATH"): print lyr.workspacePath This tool gave me the workpath for each file in my mxd. But that's when I noticed that this is the reason why it doesn't work. (See attachment DataConnection) The 02_Reference.sde is the same as Reference Data.sde but before I named it Reference Data.sde I called it 02_Reference in Catalog. Then I uploaded files to the database and then changed the name to Reference Data.sde. But somehow the name that you have set your database connection to will stick to your layer that you upload. Basically when I run the python script it should tell me instead of 02_Reference.sde the connection is called Reference Data.sde, because obviously there isn't a connection anymore that is called 02_Reference.sde (see SDEConnections.jpg). Do you understand what I mean? It's just very frustrating to spend a lot of time on a tool that doesn't work just to find out it's something absurd like that. So now back to my original question, what happens to data which is uploaded by a different user and obviously everyone can name their databases in Catalog differently?
... View more
05-15-2012
11:34 PM
|
0
|
0
|
269
|
POST
|
Hi everyone, I just created a little Python tool to change the workspace of files in my mxds from my Staging Environment to the Production Environment so I don't have to open up the mxds manually and change them that way. Anyway while I was working on it I was wondering why there are always a couple files that won't change their workspace. I tried the tool in IDLE and checked for the workspace for each feature class and noticed there are older SDE Connection names listed as my workspace for some files. Basically I had my SDE databases called Old_Staging and changed it to New_Staging after a while. In between I added data to the database. Now the files that were added while the connection was called Old_Staging it's still called Database Connections\Old_Staging.sde . This makes it very annoying to write tools because you have to make sure you include all possible names. What happens if someone else adds data and they have named their database differently? Is there a way of changing those feature class workspaces? I find it very strange that you can change so easily the connection in ArcCatalog but then again it doesn't change the workspace name for the files in it. Cheers, Dorothee
... View more
05-09-2012
10:14 PM
|
0
|
3
|
409
|
POST
|
Hi, I would be interest in this too. I would like to do that with Polygons. If anyone figures it out it would be good to know. Im sure you can do it with Python but I don't know how. Cheers
... View more
09-25-2011
08:48 PM
|
0
|
0
|
454
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|