POST
|
I ran into this too. My first solution was to split out the processing to a first script that walked the directories to find MXDs and then used subprocess.Popen to call second script that accepted the MXD path as an argument . This way the script doing the processing would only run one MXD and then close. The downside is that I had to wait for arcpy to import on every single one, and for 1100 MXDs that adds up. I'm not 100% sure why the error occurs when you run more than one MXD but I think that replaceDataSource() eats up the connection pool to the target SDE. After processing an MXD or two you can't connect to it any more. The solution is to reset the SDE connection with arcpy.ClearWorkspaceCache_management(). You also should delete the reference to your mxd object first. A simplified example of your code would look like: for dirName, subdirList, fileList in os.walk(source_dir): for fname in fileList: if fname.endswith(".mxd") mxd = arcpy.mapping.MapDocument(os.path.join(dirName,fname)) for lyr in arcpy.mapping.ListLayers(mxd): if not lyr.supports("DATASOURCE"): continue if "\GIS Data\Arc Layers\Example.shp" in lyr.dataSource: newPath = r"Database Connections\SDEConnection.sde" newSource = "Example" try: print "Replacing data source of " + lyr.name lyr.replaceDataSource(newPath,'SDE_WORKSPACE', newSource) except Exception, e: print e del mxd arcpy.ClearWorkspaceCache_management(r"Database Connections\SDEConnection.sde")
... View more
01-27-2017
04:34 PM
|
2
|
0
|
1115
|
IDEA
|
Make it so rotated point labels utilize the Offset, Best Position functionality. Here, I'm labeling with Offset, Best Position: There are 3 labels dropped, and I can't easily tell which label goes with which point. Here I tried angling the labels by attribute (45 degrees), using Offset, Best Position. Better, but they're all labeling to the Northeast, and dropping the label when they don't fit. Seems like a bug. If angled lables would use the Best Position functionality, they'd look like this: So, that would be good. But the best option yet would be to make rotating point labels a Fitting Strategy option (like what is offered for polygon labels):
... View more
07-23-2013
02:00 PM
|
18
|
4
|
930
|
IDEA
|
-->
Dimension feature classes are assigned fixed symbology when the feature class is created. Text size, line weights, etc, can't be changed afterward (except by assigning a new dimension style to the whole feature class). Please allow the symbology and text of the dimensions to be editable in ArcMap.
... View more
01-10-2013
01:28 PM
|
11
|
0
|
279
|
IDEA
|
When you have overlapping map layers that have popups, there is a bar at the top that allows you to toggle to the next layer. But there is no way to control the order of which popup is displayed first. Please give control to this, or make popup come up in the same order as the legend.
... View more
11-02-2012
03:01 PM
|
517
|
89
|
21763
|
POST
|
I can't figure out how to change the ToolTip to 10pt bold Arial font. I can only get the font-weight: bold to work with 11pt font and larger. Any ideas?
... View more
07-14-2010
10:50 AM
|
0
|
1
|
518
|
Title | Kudos | Posted |
---|---|---|
517 | 11-02-2012 03:01 PM | |
2 | 01-27-2017 04:34 PM | |
11 | 01-10-2013 01:28 PM | |
18 | 07-23-2013 02:00 PM |
Online Status |
Offline
|
Date Last Visited |
07-12-2022
04:50 PM
|