POST
|
In a new mxd the code works. The problem seems to have been with the mxd. Thank you very much for trying to help me.
... View more
04-06-2013
11:00 AM
|
0
|
0
|
938
|
POST
|
This is the code I tried to export graphs with but I get the same graph for every selected feature: import arcpy,os
path = os.getcwd()
pageCount = 1
mxd = arcpy.mapping.MapDocument(path + r"\test_graph_exp.mxd")
df = arcpy.mapping.ListDataFrames(mxd)[0]
lyr = arcpy.mapping.ListLayers(mxd, "Counties_sel")[0]
list_of_attributes = [row.getValue('Name') for row in arcpy.SearchCursor(lyr.dataSource)]
for bez in list_of_attributes:
#Make a graph for each line of the attribute table
whereClause = "\"name\" = '" + bez + "'"
lyr.definitionQuery = whereClause
arcpy.SelectLayerByAttribute_management(lyr,"NEW_SELECTION", whereClause)
arcpy.SaveGraph_management("test_graph", (path + r"\graph" + str(pageCount) + ".bmp") , "MAINTAIN_ASPECT_RATIO", "600", "375")
arcpy.SelectLayerByAttribute_management(lyr, "CLEAR_SELECTION")
pageCount = pageCount + 1
del mxd
... View more
04-04-2013
12:05 AM
|
0
|
0
|
938
|
POST
|
How are you creating the graph? i have successfully done this with arcpy and matplotlib for data driven pages. I have created graphs with ArcGis (something like View --> Graphs --> Create Graph) also in the Python window in ArcGIS without matplotlib, similiar to the sample script here http://resources.arcgis.com/en/help/main/10.1/index.html#//018z0000005t000000
... View more
04-03-2013
01:53 PM
|
0
|
0
|
938
|
POST
|
Hello, I need to make export reports with graphs. One map and one graph for each selected feature in a loop. When I add the graph to the layout and set the graph so that it only shows the values of the selected features it doesn't update when a new feature is selected with arcpy. Also setting the graph to show all values and making a query that only the selected feature is shown, doesn't work. Still the graph doesn't update. Embedding the graph to the layout of the map would be my favourite. My second unsuccessful try was to select features and export the resulting graph with SaveGraph_management, but here I experienced the same problem. When I select features manuelly/write a definition query manually the graph updates. I would be really happy if you could help me, I've been trying to solve this problem for quite a few hours. Thanks, Pedol
... View more
04-03-2013
12:21 PM
|
0
|
8
|
6330
|
POST
|
Thank you very much, Chris. I used Union and then calculated the area ratios with the Field Calculator. First calculate geometry of layer A, then Union, then calculate geometry of the new polygons, then calculate the ratio of the two numbers. I was hoping for something more elegant that leaves me with the old polygon sizes and their area ratios written to the attribute table. This Union way is a bit less elegant, but it also works.
... View more
02-06-2013
09:03 AM
|
0
|
0
|
678
|
POST
|
Hello, I have two polygon layers with polygons. Both layers share many borders, but not all. I would like to know how many polygons of layer A have a substantial part of their area in more than one polygon of layer B. Maybe it's possible to have the area of each polygon from layer A that lies in the biggest underlying polygon of layer B written to the attribute table of layer A? My license is ArcView only.
... View more
02-05-2013
12:17 PM
|
0
|
2
|
3275
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|