|
POST
|
Have you tried creating a layer file that references the service? Then try using arcpy.mapping UpdateLayer or AddLayer followed by RemoveLayer. Jeff
... View more
10-04-2013
07:39 AM
|
0
|
0
|
1484
|
|
POST
|
You'll want to work with validation scripts. You get to validation scripts by right-clicking on a script tool, go to properties, and selecting the validation tab. Here is a sample script that updates a parameter with layer names once a map document def updateParameters(self): """Modify the values and properties of parameters before internal validation is performed. This method is called whenever a parmater has been changed.""" import arcpy if self.params[0].value: mxd = arcpy.mapping.MapDocument(self.params[0].value.value) lyrs = arcpy.mapping.ListLayers(mxd) layerList = [] for lyr in lyrs: layerList.append(lyr.name) uniqueList = list(set(layerList)) uniqueList.sort() if not self.params[1].altered: self.params[1].filter.list = uniqueList return There is an arcpy.mapping sample scripts download that has about 20 different script tools and several different validation scripts. http://www.arcgis.com/home/item.html?id=18c19ec00acb4d568c27bc20a72bfdc8 The sample above is from the Replace Layer with Layer File example. Jeff
... View more
10-04-2013
07:34 AM
|
0
|
0
|
2284
|
|
POST
|
Posting to this forum too. That is because when the application is actually open the data frame window has a defined size. But when you run a stand-alone script, the application isn't actually open, there is not a real point of reference and depending on your system settings, you may get different results on diferent machines. Using a page layout that has a defined page space whether open or not, you will get consistent results. Also - defining a page layout size and fixed dataframe size on the layout you will get consistent results. Otherwise when you resize the TOC, the application, etc, the data frame size will be different. etc, etc, Jeff
... View more
10-04-2013
06:32 AM
|
0
|
0
|
3305
|
|
POST
|
That is because when the application is actually open the data frame window has a defined size. But when you run a stand-alone script, the application isn't actually open, there is not a real point of reference and depending on your system settings, you may get different results on diferent machines. Using a page layout that has a defined page space whether open or not, you will get consistent results. Also - defining a page layout size and fixed dataframe size on the layout you will get consistent results. Otherwise when you resize the TOC, the application, etc, the data frame size will be different. etc, etc, Jeff
... View more
10-04-2013
06:30 AM
|
0
|
0
|
1719
|
|
POST
|
Yes, this bug was addressed during a 10.1 SP. I just retested the original use cases and the original bug is still fixed. It is possible you have a slightly different scenario. Please contact support services so we can isolate and fix the issue. Jeff
... View more
10-03-2013
11:00 AM
|
0
|
0
|
2100
|
|
POST
|
The easiest solution is to create a page layout the size of the desired data frame and export the layout, not the data frame. See response to related post. http://forums.arcgis.com/threads/93836-ExportToTif-width-height-calculation Jeff
... View more
10-03-2013
07:16 AM
|
0
|
0
|
1719
|
|
POST
|
This may be a more simple solution: Create a page layout that is the size AND shape of the output image you want to create (with dataframe exports you can't specify page size, only pixel width/height). On the layout you will have a single data frame with your data. Export the layout rather than the data frame. Here is a snippet from the help: Controlling graphic quality of the generated image differs for page layout exports versus data frame exports. When exporting a page layout, control image detail by changing the resolution parameter. When exporting a data frame, keep the resolution parameter at its default value, and change the df_export_width and df_export_height parameters to alter image detail. The height and width parameters directly control the number of pixels generated in the export file and are only used when exporting a data frame. Images with larger numbers of pixels will have higher image detail. For most page layout exports, the default parameter values should generate good results and nice looking export images on the first try. For data frame exports, you may need to experiment with the df_export_width and df_export_height values a few times before getting the result you want. If you have to export a data frame, then multiply the resolution (default=96) times the size (this is a general rule but results can vary from machine to machine). For example if i want a 3 inch x 3 inch output, then my export_height and export_width will = 288 (96x3). Jeff
... View more
10-03-2013
07:13 AM
|
0
|
0
|
3305
|
|
POST
|
There are two solutions available for download. The first is an example of graphic tables. The linework is static on the layout but the text dynamically fills in the cells. http://www.arcgis.com/home/item.html?id=af4fe32a93554eadbd3be3b0e55326be The second example is true dynamic tables. The linework and text is dynamic from page to page. The tabular infomation also resizes itself to "fit" within a given area. http://www.arcgis.com/home/item.html?id=3a525b986b774a3f9cbbd8daf2435852 Jeff
... View more
09-26-2013
06:11 AM
|
0
|
0
|
2417
|
|
POST
|
I'm not clear on the following: I have 50 polygons named P1 to P50 which I want to merge. I cannot find any way to keep the layer names of the origional polygons Does this mean that you have 50 polygon feature classes (aka layers) or is this a single feature class with 50 polygons? Jeff
... View more
09-11-2013
07:46 AM
|
0
|
0
|
7501
|
|
POST
|
UpdateLayer with symbology_only=False needs to be used with caution. Make sure you read the help topic. The most basic requirement is to only update layer symbology (and that has limits too). If you want to update any other property that is available via layer properties, and is not a specific arcpy.mapping layer property (e.g., update selection symbology or field aliases, label properties, etc) you need to use UpdateLayer but realize that all layer properties will be changed. Scenario - I have a layer in dozens of MXDs. I want to change the label properties for the layer but I don't want to have to physically open up dozens of MXDs. In this scenario, open one of the MXDs, modify the layer appropriately, save it to a LYR file and then iterate through all MXDs, find the layer of interest and update it using the layer file properties. If you are trying to update layers with layer files that are referencing very different data, things won't work as expected. I hope this helps, Jeff
... View more
09-11-2013
07:40 AM
|
0
|
0
|
1492
|
|
POST
|
The default value for UpdateLayer's {symbology_only} parameter is True. Set this to False for ALL properties to be updated. Note - it updates all properties, even data source. Try:
arcpy.mapping.UpdateLayer(df, outputlyr, symbologylayer, False)
Jeff
... View more
09-10-2013
07:05 AM
|
0
|
0
|
1492
|
|
POST
|
It would be nice to see the functions as well. What is the value of your newDBPath? They should be just the name of the dataset, not the data source. Perhaps you could change the value to equal layer.datasetName. Jeff
... View more
09-03-2013
06:02 AM
|
0
|
0
|
3700
|
|
POST
|
You can iterate through all layers and test for Layer.isGroupLayer. If it returns false, set visible = False. Jeff
... View more
08-22-2013
06:13 AM
|
0
|
0
|
2327
|
|
POST
|
These names are being generated internally by the Adobe library based on the name of the "single" PDF file name. There is nothing that can be done using this approach. I think the best workaround is to automate this using arcpy.mapping: 1) export each DDP page as a single page (using page name or page number as the identifier). 2) Use PDFDocumentCreate to generate each a new PDF. 3) Append the pages from step 1 in to the new PDF. 4) saveAndClose() the final PDF. 5) delete single PDFs from step 1 6) open in Adobe and the pages should appear as you want. The other work around is to manually rename the tmp files using Adobe Pro. Jeff
... View more
08-20-2013
10:45 AM
|
0
|
0
|
978
|
|
POST
|
This is double posted. A response can be found at: http://forums.arcgis.com/threads/90311-Has-anyone-modified-UniqueValuesSymbology�??s-Lyr.symbology.classLabels-successfull?p=320348&posted=1#post320348 Jeff
... View more
08-12-2013
06:35 AM
|
0
|
0
|
1373
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-05-2025 11:20 AM | |
| 3 | 06-05-2025 09:21 AM | |
| 1 | 05-14-2025 01:19 PM | |
| 2 | 04-24-2025 07:54 AM | |
| 1 | 03-15-2025 07:19 PM |
| Online Status |
Offline
|
| Date Last Visited |
06-23-2026
10:29 AM
|