POST
|
Note: the Refresh functions are only needed when referencing a map document using the "CURRENT" keyword. Not all functions automatically refresh the current ArcMap application. When referencing a map document via a system path, the refresh functions are not required. Jeff
... View more
11-12-2010
04:23 AM
|
0
|
1
|
1104
|
POST
|
How large is your result? Have you compared the export size from arcpy.mapping to the same export via the ArcMap user interface? They should be the same. Please let me know if you see differences. If arcpy.mapping is producing a result that is different from the UI export, they we must know that. FYI - With SP1 we've introduced additional compression options/settings.
... View more
11-11-2010
09:24 AM
|
0
|
0
|
350
|
POST
|
Hello Eric, Based on the testing we've done together, it appears your issue is resolved with SP1. Several issues have been addressed that are specific to change SDE data sources. Thanks for your help, Jeff
... View more
11-03-2010
11:42 AM
|
0
|
0
|
450
|
POST
|
Hello Eric, I'm not sure if the problem you are having is with your .replace statement. You are not using the raw (r) format, the back slashes may be causing a problem. Try: lyr = arcpy.mapping.Layer(r"C:\temp\index.lyr") lyr.findAndReplaceWorkspacePath(r"C:\", r"D:\") lyr.save()
... View more
10-25-2010
08:09 AM
|
0
|
0
|
450
|
POST
|
Hello Brent, Have you tried using the GP Describe object? desc = arcpy.Describe("PathToFC") dfExtent = df.extent dfExtent.XMin = desc.XMin dfExtent.XMax = desc.XMax dfExtent.YMin = desc.YMin dfExtent.YMax = desc.YMax df.extent = dfExtent Jeff
... View more
10-25-2010
07:54 AM
|
0
|
0
|
793
|
POST
|
Hello Paul, Have you tried testing your lines of code in the Python Window of ArcMap? Here you would see immediate feedback with the code you are testing. For example. filePath = os.path.dirname(mxd) throws a "Map Document object is not subscriptable". Perhaps an alternative would be to use filePath = os.path.dirname(mxd.filePath) I'm also a little concerned with trying attempting to close the application that is currently open. After doing a little pthon searching, it appears you would need to call other modules to actually close an application (e.g., the win32com module). This would be much easier if you were not using "current". os.startfile(mxd.path) is a way to open the resulting mxd. I hope this helps a little, Jeff
... View more
10-21-2010
06:59 AM
|
0
|
0
|
415
|
POST
|
It should not matter if the raster is in a different folder. I was going to provide an alternative approach but then learned about the SP1 fix concerning the extension as part of the string. Please keep us posted, Jeff
... View more
10-13-2010
12:10 PM
|
0
|
0
|
942
|
POST
|
Daniel, Try removing the extension from the file name. Try: lyr.replaceDataSource("E:/Projects", "RASTER_WORKSPACE", "NewLayer_2010") This issue was addressed for SP1. Please let me know if this does not work for you. At SP1 you'll be able to use your original line of code. Thanks again, Jeff
... View more
10-13-2010
08:48 AM
|
0
|
0
|
942
|
POST
|
Hello Daniel, Is your new raster in the same workspace (i.e., folder) as the old raster? Jeff
... View more
10-13-2010
08:18 AM
|
0
|
0
|
942
|
POST
|
Unfortuneately you won't be able to. Arcpy.mapping is a new module at 10 and is not backward compatible. Jeff
... View more
10-01-2010
06:39 AM
|
0
|
0
|
658
|
POST
|
Oops - I see you found the solution. Great job! The "always run in foreground" option was specifically added due to CURRENT. Current uses the application in memory and if you run in background, the current application can't be referenced. Jeff
... View more
09-27-2010
06:40 AM
|
0
|
0
|
402
|
POST
|
Hello Ryan, I was hoping you had background processing enabled. But you don't. That must be turned off for CURRENT to work within a script tool. Everything you say should be working the way you expect it to. Could you please send me your script/ script tool to jbarrette@esri.com. I'd like to look at it a bit more. Jeff
... View more
09-27-2010
06:38 AM
|
0
|
0
|
402
|
POST
|
ArcGIS 9.3 applications can NOT read the ArcPy site package newly available at 10 so import arcpy is not understood by 9.3. You can replace import arcpy with import arcgisscripting - both 9.3 and 10 can use that. This will work if you are only using capabilities available at 9.3. There are some new functions that won't be backwards compatible (e.g, all of arcpy.mapping).
... View more
09-23-2010
07:38 AM
|
0
|
0
|
658
|
POST
|
All, The "Calculate Adjacent Fields" tool found in the Cartography System toolbox is very limiting. It really only works with the output of the "Grid Index Features" tool in the same toolbox. It requires that all polygons be orthogonal with only 4 vertices per feature, etc. We hope to improve these limitation in a future release. In the meantime, we've created a sample script tool that is not nearly as limiting. Please download and review the script from: http://resources.arcgis.com/gallery/file/geoprocessing/details?entryID=3B67F638-1422-2418-A00C-D271D1E954CB
... View more
09-22-2010
01:59 PM
|
0
|
1
|
761
|
POST
|
We have confirmed that this is a bug for 10.0 final (and too late to fix for SP1). SaveACopy does appear to work with CURRENT but NOT with stand-alone scripts/script tools. mxd = arcpy.mapping.MapDocument("current") mxd.saveACopy(r"C:\path\someNew.mxd", "9.3") If you are experiencing this issue, please call techincal support and have your name associated with NIM061274. It will help with expediting a fix for the issue. Jeff
... View more
09-20-2010
02:52 PM
|
0
|
0
|
500
|
Title | Kudos | Posted |
---|---|---|
1 | 08-05-2024 02:52 PM | |
1 | 08-05-2024 09:13 AM | |
1 | 07-31-2024 07:11 AM | |
1 | 02-09-2024 03:08 PM | |
1 | 01-23-2024 09:51 AM |
Online Status |
Offline
|
Date Last Visited |
a week ago
|