POST
|
GraduatedColorsRenderer looks more like something to adjust the actual color of the symbology. I want to be able to say something along the lines of --- there are 3 breaks --- break one = 4, break two = 7, break three = 15 (in Python code obviously)
... View more
01-10-2018
08:49 AM
|
0
|
1
|
688
|
POST
|
In ArcMap you could assign values to each break within a layer's graduated color symbology using classBreakValues and classBreakLabels (A code sample of this can be seen on this page http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/graduatedcolorssymbology-class.htm). However, I have now transitioned over to ArcGIS Pro and since the ArcPy between Map and Pro are different I can't figure out how to assign values to each break within a layer's graduated color symbology. At first I thought that the ClassBreak (https://pro.arcgis.com/en/pro-app/arcpy/mapping/classbreak-class.htm) would accomplish what I'm looking for but once I looked at the sample code I don't think it will. Is it possible to assign values to each break within a layer's graduated color symbology in ArcGIS Pro? Am I correct in thinking that the ClassBreak will not accomplish what I'm trying to do?
... View more
01-10-2018
07:50 AM
|
0
|
4
|
1182
|
IDEA
|
I'm currently having this same issue. Has anyone found a work around, or some other way to get the "Complete Symbology Definition" in ArcGIS Pro? Would using ArcPy potentially work?
... View more
01-04-2018
12:15 PM
|
1
|
0
|
18570
|
POST
|
The final code I used to get the results I was looking for is: import arcpy
from arcpy import env
import sys
import os
import datetime
elm_name = "My Dynamic Title" # the name you assign to the title (TEXT) element
p = arcpy.mp.ArcGISProject(r"C:\arcGIS_Shared\Python\CenterHeatMaps.aprx")
for lyt in p.listLayouts("Layout_King"): # get the element
for elm in lyt.listElements("TEXT_ELEMENT"):
if elm.name == elm_name:
text_elm = elm
break
for m in p.listMaps(): # loop through your layer / layouts / maps
for lyr in m.listLayers("BCBS*"):
new_title=lyr.name # do your logic with the layer
elm.text=new_title
lyt.exportToPDF(r"C:\arcGIS_Shared\Exports" + "\\BCBS_" + elm.name[13:] + ".pdf") # export the map
print(elm.name[13:]) Thank you everyone for your help and input!
... View more
12-22-2017
05:12 AM
|
2
|
1
|
2544
|
POST
|
Xander, thanks for all your help with my question. I realize that the code you are suggesting is untested, so I have been experimenting with it the best I can. Here is my updated version of your code: import arcpy from arcpy import env import sys import os import datetime elm_name = "My Dynamic Title" p = arcpy.mp.ArcGISProject(r"C:\arcGIS_Shared\Python\CenterHeatMaps.aprx") for lyt in p.listLayouts("Layout_King") [0]: for elm in lyt.listElements("TEXT_ELEMENT"): if elm.name==elm_name: text_elm=elm break for m in p.listMaps(): for lyr in m.listLayers("BCBS*"): new_title=lyr.name elm.text=new_title lyt.exportToPDF(r"C:\arcGIS_Shared\Exports" + "\\BCBS" + elm.name[13:] + ".pdf") print(elm.name[13:]) But when I try and run it it gives me the following error: Traceback (most recent call last): File "<string>", line 8, in <module> TypeError: 'Layout' object is not iterable Do you know what I'm doing wrong? Also, does it look like I'm at least on the right track?
... View more
12-21-2017
04:50 AM
|
0
|
1
|
2021
|
POST
|
I'll just list the steps that the script goes through. 1) Geocode Addresses 2) Summarize Within Loop based on locations (80 locations) - so 80 feature classes 3) Apply Symbology to 80 feature classes 4) Export PDFs after referencing Bookmarks (80 bookmarks based on the previous locations) So each layout is based on a different Bookmark and depicts the corresponding feature class also
... View more
12-19-2017
09:10 AM
|
0
|
3
|
2021
|
POST
|
I forgot to specify that it is really just one layout that is being used as a template. So the 80 PDFs are really just different versions of the same layout
... View more
12-19-2017
08:24 AM
|
0
|
5
|
2021
|
POST
|
I updated my question in response to your TextElement suggestion
... View more
12-19-2017
07:55 AM
|
0
|
7
|
2021
|
POST
|
Is there a way to make the title of a layout dynamic with a feature class? I know there is dynamic text with the Map Frame, Project Name, Metadata, and many other things. From the research I have done it seems like it might have been possible in ArcMap, but I have been unable to find anything in ArcGIS Pro that would allow for the layout title to be dynamic with a feature class. To expand a little further. I have a large arcpy script where 80 layouts are created (from 1 template layout) and exported into a PDF, but right now each layout has the same generic title so sometime it is hard to know what data is being shown in the layout. This problem could be solved if the layout's title was Dynamic with the feature class that is being portrayed in the layout. I considered using the following code, which uses the TextElement, but it looks to me like I would have to specify each individual title for every layout. And if I have 80+ layouts, that could take a long time. p = arcpy.mp.ArcGISProject("Current")
for lyt in p.listLayouts():
for elm in lyt.listElements("TEXT_ELEMENT"):
if elm.name == "title": # this is the element name set via text properties
# add layout feature class check logic
elm.text = "New Title" # changing title name Am I reading this right? Is there a better way?
... View more
12-18-2017
01:04 PM
|
1
|
11
|
3703
|
POST
|
I used the following code to get the results I was looking for: p = arcpy.mp.ArcGISProject("CURRENT") m = p.listMaps()[0] lyr = m.listLayers("layer_name")[0] sym = lyr.symbology if sym.renderer == "GraduatedColorsRenderer": breaks = sym.renderer.classBreaks for b in breaks: b_int = b.label[0:-7] b.label = b_int lyr.symbology= sym
... View more
12-18-2017
07:43 AM
|
1
|
0
|
784
|
POST
|
Yes I need to use arcpy because I want to implement it into a larger script
... View more
12-15-2017
09:42 AM
|
0
|
1
|
784
|
POST
|
Whenever I perform the Summarize Within tool in ArcGIS Pro and use the graduated colors symbology on the resulting feature class, I end up with something that looks like this: Is there a way to remove all those zeros? In other words can I set the results to zero decimal places using Arcpy for ArcGIS Pro?
... View more
12-15-2017
08:58 AM
|
0
|
4
|
1119
|
POST
|
I want it to select a .lyrx from a geodatabase from within an ArcGIS Pro project. Does that answer your question?
... View more
12-05-2017
08:07 AM
|
0
|
1
|
1794
|
POST
|
I have a table in my geodatabase that has urgent care patient visits listed by market. I'm trying to develop a script that will select a certain lyrx based on what market the patient visit took place in. From the research I've done, it looks like the "if", "elif", and "else" statements would accomplish what I'm trying to do. I'm thinking it would something like this: if Market_ID = = "1000" : print "NY_ZipCodes" elif Market_ID = = "2000" : print "CT_ZipCodes" elif Market_ID = = "3000" : print "CA_ZipCodes" else : print "This program has an error" Obviously I need to replace the "print" statement (with the exception of "else"), but I don't know what to replace it with. Does anyone know what should replace "print"? Am I on the right track? Is there a better way to do what I'm trying to do?
... View more
12-05-2017
07:25 AM
|
0
|
4
|
3006
|
POST
|
Table Select fixed the problem. Thank you everyone for your help!
... View more
12-05-2017
06:19 AM
|
0
|
0
|
1777
|
Title | Kudos | Posted |
---|---|---|
1 | 12-18-2017 07:43 AM | |
1 | 11-20-2017 07:14 AM | |
2 | 12-22-2017 05:12 AM | |
1 | 12-18-2017 01:04 PM | |
1 | 01-04-2018 12:15 PM |
Online Status |
Offline
|
Date Last Visited |
07-15-2022
02:04 PM
|