POST
|
I have in my job several MXDs (more than 500) and each one is different from another. There is one specific shapefile (project_area_03-jan-2015.shp) that every map uses. The big problem: Every week, the shapefile changes, and also changes the name of the shapefile: project_area_03-jan-2015 means its the 3rd week of january 2015 project_area_04-jan-2015 means its the 3th week of january 2015, and goes forever. For our actual projects, we changed the way we built the mxds and the shapefiles, so we dont have any problems. But for this specific old (very old, before 2008), we still have the old architecture of the files. Every week, we make a copy to another folder and open all +500 MXDs, then 'change data source' in that shapefile, to the new one. We tried to use 'MapDocument.findAndReplaceWorkspacePaths' python, but it changes only the path. We need a script to change the entire path from the shapefile. I want some help, that ghanges the shapefiles for me, in all MXDs inside the folder, like; from d:\projectalpha\project_area_03-jan-2015.shp to d:\projectalpha\project_area_04-jan-2015.shp Thanks
... View more
01-20-2015
11:39 AM
|
0
|
2
|
4098
|
POST
|
Awesome!! I changed something: The output name will not be "map_document.mxd.jpg" anymore... It'll be just "map_document.jpg" And you can set some quality options (DPI and compression):
import arcpy, os
inputPath = os.curdir
outputPath = os.curdir
#Loop through each MXD file
for filename in os.listdir(inputPath):
fullpath = os.path.join(inputPath, filename)
if os.path.isfile(fullpath):
if filename.lower().endswith(".mxd"):
#Reference MXD and export
mxd = arcpy.mapping.MapDocument(fullpath)
OutputJPGPath = os.path.join(outputPath, filename.replace(".mxd", ".jpg"))
#arcpy.mapping.ExportToJPEG(mxd, OutputJPGPath)
arcpy.mapping.ExportToJPEG(mxd, OutputJPGPath, 'PAGE_LAYOUT', 0, 0, 200, "False", '24-BIT_TRUE_COLOR', 100)
... View more
11-21-2013
05:58 AM
|
0
|
0
|
429
|
IDEA
|
-->
It will be good to have a way to automatically change the legend patch for some layers. A simple way to do that is matching the patch and layer by name, just like when you have a simbology and a shapefile with the same name. Thanks
... View more
12-21-2012
06:41 PM
|
4
|
0
|
160
|
POST
|
Hi everyone... I have here this hydrography feature, but it was created without respect the flow direction... I mean, some features are pointing upstream and some are pointing downstream... There is no standard, it was created randomly... Once i fixed another feature like that with the 'flip' tool, but it was a small area... This time, it has about 11k segments and it would take a lot of time... So, is there any tool or process that can help me to fix this hydrography feature?
... View more
05-21-2012
05:43 AM
|
0
|
0
|
349
|
POST
|
Hi everyone... I have here this hydrography feature, but it was created without respect the flow direction... I mean, some features are pointing upstream and some are pointing downstream... There is no standard, it was created randomly... Once i fixed another feature like that with the 'flip' tool, but it was a small area... This time, it has about 11k segments and it would take a lot of time... So, is there any tool or process that can help me to fix this hydrography feature?
... View more
05-21-2012
05:40 AM
|
0
|
4
|
580
|
POST
|
i didnt understand exactly what you want... you'll always have only one field in your shapefile (called Leistung) to calculate this values, but in a lot of shapefiles... Is that right? I think you should explain better what you want...
... View more
01-18-2012
07:41 AM
|
0
|
0
|
460
|
POST
|
this is exactly what i was looking for: http://resources.esri.com/help/9.3/arcgisdesktop/com/gp_toolref/automating_your_work_with_models/branching_colon_implementing_if_then_else_logic.htm it creates a 'python script' with the 'if condition'... and it does it that exactly looking for a 'field name'... impossible better!
... View more
01-12-2012
04:10 PM
|
0
|
0
|
306
|
POST
|
Problem solved. The tools do not work when the attribute table is open. Pete actually, i still get this error... even with attribute table closed... anything else that you changed?? **EDIT: Service Pack3 solved my problem.... Even in toolbox, the 'field calculator' wasnt working... Now it works perfectly... And now i notice that, if the 'attribute table' is open, the results of the calculation doesnt show untill you refresh it...
... View more
01-12-2012
02:51 PM
|
0
|
0
|
171
|
POST
|
Hi everyone... First of all, sorry if my post isn'n in the right sub-forum, but i really dont know where to post it... So, i want to make a very simple model (actually i already did) where it will be created 5 specific columns in several existing shapefiles, with the same value in the entire column... This is ver simple... Just 'Add Field' (with their specifications) and then 'Calculate Value' for the column... Like this: [ATTACH=CONFIG]11133[/ATTACH] The entire script is not that, this is a piece of that... Showing only this is a simple way to explain what is my problem: Some shapefiles already have a column with the same 'Field Name' that i want to create... When i run the script, ArcMap shows the 'Warning 000012: Field already exists' but the script keep going (this is good, it doesnt stop ever). Then it runs the 'Calculate Value' in the pre-existing field and this is my problem... I want to skip the 'Calculate Value' if the field already exists in the shapefile... I want to create and set a 'default' value to the fields only in the shapefiles that doesnt have that field... And i have a thousands of shapes, so i cant do it one by one... So, is there a way to put an 'if' in the model builder?? Like " 'if warning 000012...' " Or is there another way to solve this problem? i need this... thanks...
... View more
01-12-2012
07:15 AM
|
0
|
1
|
444
|
POST
|
Hi. I have a shape that is a raster index. there is the 'path' field in the attribute table to the rasters (like .tif .img .ecw) and i want to use the 'hyperlink' function to add raster to the map. does anyone know how to do it in ARCGIS 10?? i found the scripts, but doesnt work in arcgis10. thanks
... View more
06-20-2011
06:56 AM
|
0
|
0
|
795
|
POST
|
hi. i want to create a script to 'add raster'. but it needs to be in 'VBScript' because i want to use it in the 'hyperlink function' of the arcmap. i have a boundary (rasters) shape that contains the path of the raster in attribute table. So, my point is: i want to load the raster in arcmap when i click with the hyperlink (like in MapInfo)... So, does anybody knows how to create a simple 'add raster' script? Instead of browse to the image, it will take the image from the [path] field. thanks
... View more
06-09-2011
11:54 AM
|
0
|
1
|
617
|
POST
|
Hi, its me again... After many many tests, i discovered some incompatibilities in the arcscene and, after fixed them, the model has been produced without any problems! here will go what i changed in my project: - the shape of the image and the dem must be the same (before i discover it, my sattelite image was larger then the DEM); - The Arcscene doesn't like to work with images (sattelites and DEMs) when their shapes have many corners. Try to split your models in others smaller models, with only four corners of each (like squares and rectangles) I changed those things and i could export it successfully!
... View more
08-17-2010
01:07 PM
|
0
|
0
|
270
|
POST
|
I have a scene comprising a satellite image with a DEM (grid) as its terrain model. The total area (km2) of my project is not so big. The arcscene can process very fast, even when i put a small pixel value in "raster resolution" and when i put a high "quality enhnancement for raster images" in the properties menu. So, my problem is: when i try to export the scene to 3D (vrml) the arcscene ends immediately. After the crash, pops up an "error report" saying that "arcgis desktop has encountered a serious application error and is unable to continue"). I tried to change to a low quality and small pixel in my model and arcscene crashed again. It only can export if i change to the lower quality image. But my model doesn't like so good when i import it to the 3D Max. It shows my project with a very bad quality. What can i do to export my project?? I already tried in other computers, with a lot of RAM and better processor and the problem still happens. Other important thing: I've had success while exporting a lot of other larger scenes and with better quality. But sometimes i have this problem and i dont know what can i do now.
... View more
08-17-2010
07:06 AM
|
1
|
2
|
4020
|
Title | Kudos | Posted |
---|---|---|
2 | 03-16-2017 06:34 AM | |
4 | 12-21-2012 06:41 PM | |
1 | 08-17-2010 07:06 AM | |
2 | 03-16-2017 06:36 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|