|
POST
|
Document versioning needs to be added. Please add this to the ideas site. There are at least 3 relevant proposals in the ideas site. Time to vote 🙂 https://c.na9.visual.force.com/apex/ideaView?id=087E00000004qGSIAY https://c.na9.visual.force.com/apex/ideaView?id=087E00000004b98IAA https://c.na9.visual.force.com/apex/ideaView?id=08730000000c1LUAAY
... View more
10-14-2013
07:50 AM
|
0
|
0
|
1321
|
|
POST
|
It finally came to me. Putting the supports("SERVICEPROPERTIES") inside a try except was the missing piece. Now I should be able to remove all broken map services without it failing when the broken layer is a TableView. See the code below. New question. Is there a way in 10.1 to determine the MXD version? I'd like to run this script on 10.1 but save out MXD in the same version as the original. mxd = arcpy.mapping.MapDocument(myMXD)
for df in arcpy.mapping.ListDataFrames(mxd):
print "*** New Data Frame"
print " Listing Data Frame Layers"
for lyr in arcpy.mapping.ListBrokenDataSources(mxd):
print " Broken DataSource: " + lyr.name
# TableViews are erroring off because that object has no attribute supports.
try:
if lyr.supports("SERVICEPROPERTIES"):
if lyr.serviceProperties['ServiceType'] == "MapServer":
print "MapServer"
print lyr.serviceProperties
except:
print "Layer has no SUPPORTS attribute: " + lyr.name
... View more
10-11-2013
12:09 PM
|
0
|
0
|
1904
|
|
POST
|
Thanks Matt, RemoveLayer will work. I've just got one last problem. Since I'm running this script for other users I don't want to remove all layers with broken datasources. A user may have data on their C: drive or a protected network folder, but since I'm running the script those layers show up as broken. .The only thing I want to remove are broken map services. Unfortunately, I haven't been able to find just map services. The line with lyr.supports("SERVICEPROPERTIES") errors off if the broken layer is a table view since TableViews don't have the SUPPORTS attribute. Any ideas. i mport arcpy
fileName = "DBS100"
myMXD = "H:/_maps/" + fileName + ".mxd"
print myMXD
mxd = arcpy.mapping.MapDocument(myMXD)
for df in arcpy.mapping.ListDataFrames(mxd):
for lyr in arcpy.mapping.ListBrokenDataSources(mxd):
print " Broken DataSource: " + lyr.name
# TableViews are erroring off because that object has no supports attribute .
if lyr.supports("SERVICEPROPERTIES"):
if lyr.serviceProperties['ServiceType'] == "MapServer":
print lyr.serviceProperties
del mxd
... View more
10-11-2013
09:59 AM
|
0
|
0
|
1904
|
|
POST
|
No, not possible in Python in ArcGIS 10 to tell what release a mapdocument is currently saved as (I'm told possibly at 10.1) -Dave Dave, Assuming you're still out there do you know if this got added to 10.1? I really need that able in a script I'm writing that strips out broken map service datasources. Thanks
... View more
10-11-2013
08:32 AM
|
0
|
0
|
4728
|
|
POST
|
We just upgraded ArcGIS Server from 10.0 to 10.1. Several users have MXDs that contain a map service that retired during the upgrade. With the map service gone those MXDs take 10 to 30 minutes to open and another 5 minutes just to right click on the service in the TOC so it can be removed. What is there in ArcPy to find and replace map services? Let me know if this topic should go in another forum. And, why the heck does ArcGIS Desktop spend so much time looking for a map service before giving up?
... View more
10-09-2013
02:58 PM
|
0
|
23
|
4086
|
|
POST
|
FYI, if you have an ELA with ESRI you don't get any additional name user licenses no matter how many desktop licenses you have 😞
... View more
09-09-2013
12:48 PM
|
0
|
0
|
885
|
|
POST
|
I think you're running into this http://resources.arcgis.com/en/help/arcgisonline/index.html#//010q00000007000000 [INDENT]The date and time in a pop-up window do not match the date and time in the underlying data. Servers store dates in Coordinated Universal Time (UTC). Web browsers convert the date to local time. For example, if you look at a time field in a pop-up window and you are located in California during standard daylight time, what you see is 8 hours earlier (UTC-8) than the time in the data. This offset might affect the date as well. If you look at a pop-up window with data from 7/7/2011 12:00 a.m., you see 7/6/2011 5:00 p.m.[/INDENT] You can vote here to show your support for getting ESRI to fix the issue. http://ideas.arcgis.com/ideaView?id=087E00000004SlJIAU
... View more
08-23-2013
08:19 AM
|
0
|
0
|
2199
|