|
IDEA
|
We understand that this idea was submitted many years ago against ArcMap, but we would like to update the community with how ArcGIS Pro's arcpy.mp module addresses the requests. Here are solutions to the original 3 bullets provided. All of these items were addressed as far back as ArcGIS Pro 2x. 1. Changing fill (solid, patterned) stroke (solid, dashed etc), colour (rgb and cmyk input values), size, font properties of single symbol - The Symbol class addresses nearly all of this: https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/symbol-class.htm - The TextElement class has members to deal with font and size: https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/textelement-class.htm - Modifying symbol additional properties on label classes would require CIM access. https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/python-cim-access.htm 2. Changing unique values, many fields symbology by selecting the field inputs, and symbology properties for each. Also include colour ramp symbology. - The UniqueValueRenderer class does all this: https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/uniquevaluerenderer-class.htm - It even supports multiple fields AND colorramps (along with other renderers/colorizers) - The “symbology properties for each” part can be done via the symbol class, or the CIM, or possibly #3 below. 3. MOST IMPORTANT!! Match symbols to a style!!!! Enable Value Field to be defined as well as .sty file location. - This was provided as part of core arcpy: https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/match-layer-symbology-to-a-style.htm We hope that sharing these details helps users implement layer symbology modifications with arcpy.mp. If you find that there is functionality that could be added that would facilitate your current workflows in ArcGIS Pro, please submit a new idea. Jeff - arcpy.mp team
... View more
04-14-2025
01:23 PM
|
0
|
0
|
1921
|
|
IDEA
|
Thanks @matt_g_g . If you write your script to work out of process along with a reference to a "blank.aprx", for example, it all would happen in memory and the application would not even be opened. To work with a mapx or a pagx file, you need the application (internal logic) to read the files in order for them to be modified. Even if you wanted to use Python CIM access to modify the JSON structure, you still need the application. Those X files are text files but I would never recommend modifying those in a text editor. If you have specific issues with import/export x-files, I'd like to know the limitations. Jeff - arcpy.mp and Layout SDK teams
... View more
03-17-2025
10:27 AM
|
0
|
0
|
1593
|
|
POST
|
@DougBrowning I've taken a look at this and I'm also bringing this to the attention of the raster team. A few things. 1) With Python, I'm able to standardize symbology across multiple rasters BUT only if I set the lowerBound of the raster. This property was made available on GraduatedColorsRenderer, GraduatedSymbolsRenderer and RasterClassifyColorizer at Pro 3.4. #Standardize multiple RasterClassifyColorizer elevation datasets p = arcpy.mp.ArcGISProject('current') m = p.listMaps('Yosemite Elevation')[0] for l in m.listLayers('*dem'): if l.isRasterLayer: lBound = 0 uBound = 300 sym = l.symbology sym.colorizer.colorRamp = p.listColorRamps('Elevation #1')[0] sym.colorizer.breakCount = 10 #final range: 0-3000 sym.colorizer.lowerBound = 0 for brk in sym.colorizer.classBreaks: brk.upperBound = uBound brk.label = f"{lBound} - {uBound} meters" lBound += 300 uBound += 300 l.symbology = sym 2) It appears I can't do this in the UI. The UI does not let me create ranges below the minimum value. It lets me create ranges for upper values that don't exist with no issue. If I try to set the lower bound via the Histogram tab but changing it to Zero has no effect on the colorizer (Unlike the GraduatedColors/symbols renderers). Even if I successfully set symbology via arcpy.mp like above, when I view the symbology pane, I get a warning. 3) There is a bug you may run into concerning labels. During Pro 3.4 development, auto apply labels behavior was added to the UI behavior and it causes arcpy.mp class label modifications to get reset. We have a fix for this at Pro 3.5 and hope to port it to a patch for 3.4. The bug is BUG-000174482. I hope this helps, Jeff - arcpy.mp and Layout (SDK) teams
... View more
03-15-2025
07:19 PM
|
1
|
0
|
1947
|
|
IDEA
|
Hi @BrettFrahm, Look at sample script #2 (at the bottom) in https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/mapseries-class.htm You just need to change the PNG to one of your formats. Let me know if this helps. Jeff
... View more
02-04-2025
09:11 AM
|
0
|
0
|
1278
|
|
POST
|
@jeremywiles1981 is this a different issue? I.e., are selected features not being exported or are you talking about something else. Can you reproduce in the UI and/or SDK? Jeff - Layout (SDK) and arcpy.mp teams
... View more
01-28-2025
11:40 AM
|
0
|
1
|
1232
|
|
POST
|
Hello, I can't identify the issue from the picture that is attached. What is "repeating itself"? Jeff - arcpy.mp team
... View more
01-24-2025
09:09 AM
|
0
|
1
|
1614
|
|
POST
|
Thanks for reporting this. We recently added a new, non-map series option on the export pane called "Show selection symbology". This should work with mapviews, non-mapseries layouts and mapseries layouts. As a result we plan to deprecate the option on the map series. BUT the following should work and it does not. We are investigating it and hope to address it immediately. async protected override void OnClick()
{
var layoutItem = Project.Current.GetItems<LayoutProjectItem>().FirstOrDefault(item => item.Name.Equals("Layout_MS"));
await QueuedTask.Run(() =>
{
Layout layout = layoutItem.GetLayout();
layout.Export(
new PDFFormat
{
OutputFileName = @"c:\temp\selected_features_MS.pdf",
DoShowSelectionSymbology = true
}
);
}); Jeff - Layout (SDK) and arcpy.mp teams
... View more
01-24-2025
08:37 AM
|
0
|
1
|
1261
|
|
POST
|
@jlgprime I can NOT reproduce this issue on released versions of the software. Could you please provide a coordinate system and perhaps a couple of screen shots so I can try to reproduce your issue. Jeff - arcpy.mp team Preview
... View more
01-15-2025
01:26 PM
|
0
|
1
|
1458
|
|
IDEA
|
@asmith_tssw - I need a reproducible case and it is so difficult to know what your script is doing and how it is interacting within the application. For example, are you running script tool within the application or are you running a stand-alone script outside of the application? Even if you could provide a bulleted list of the order of operations, that could be helpful.
Jeff
... View more
11-15-2024
01:45 PM
|
0
|
0
|
2982
|
|
IDEA
|
@asmith_tssw could you share a small snippet of code that demonstrates what the script tool is doing?
Thanks,
Jeff - arcpy.mp and Layout (SDK) teams
... View more
11-14-2024
03:19 PM
|
0
|
0
|
3013
|
|
IDEA
|
@DougBrowning are you working straight text? With straight text, regardless of alignment if you change the string to be something shorter, the text envelope that contains the text will be left aligned since that is the anchor point location. If you change the anchor position to center and then modify the string, it should stay center aligned.
Jeff - arcpy.mp and Layout (SDK) teams.
... View more
11-14-2024
03:17 PM
|
0
|
0
|
3014
|
|
IDEA
|
Thanks again for your idea! This is implemented in ArcGIS Pro 3.4. Go to Your Ideas in ArcGIS Pro 3.4 to see other ideas implemented this release and check out the What's New help to learn about everything that is new and improved in ArcGIS Pro 3.4.
Jeff - Layout (SDK) and arcpy.mp teams
... View more
11-12-2024
09:06 AM
|
0
|
0
|
3156
|
|
POST
|
Try this link: https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic76003.html
Jeff - Layout and arcpy.mp teams
... View more
10-07-2024
07:57 AM
|
0
|
0
|
2732
|
|
POST
|
@AntoinePrince1805
One of the efficiencies of the CIM is also one of its limitations. The CIM mostly persists non-default data to minimize its size and improve performance. So if no alterations are made to default field info, the field info does not appear in the CIM definition.
Try the code below. The trick is to use MakeFeatureLayer which does include the CIM definitions, make alterations and copy the updated CIM information to your target layer.
p = arcpy.mp.ArcGISProject('current')
m = p.listMaps()[0]
lyr = m.listLayers('Provinces')[0]
lyr_cim = lyr.getDefinition('V3')
fList = ["SQKM", "POP2001", "Shape_Length", "Shape_Area"]
#IF NO CIM FIELD DESC INFO IS AVAILBLE
if len(lyr_cim.featureTable.fieldDescriptions) == 0:
print('No CIM Field Info')
#Make temporary layer (which automatically gets CIM field info)
mkLyr = arcpy.management.MakeFeatureLayer(lyr)[0]
mkLyr_cim = mkLyr.getDefinition('V3')
for fd in mkLyr_cim.featureTable.fieldDescriptions:
if fd.fieldName in fList:
fd.numberFormat.roundingOption = "esriRoundNumberOfDecimals"
fd.numberFormat.roundingValue = 0
fd.numberFormat.zeroPad = True
mkLyr.setDefinition(mkLyr_cim)
#Copy CIM information and remove temporary layer
lyr_cim.featureTable.fieldDescriptions = mkLyr_cim.featureTable.fieldDescriptions
lyr.setDefinition(lyr_cim)
m.removeLayer(mkLyr)
Jeff - arcpy.mp and Layout teams
... View more
10-04-2024
08:31 AM
|
1
|
1
|
2402
|
|
IDEA
|
Thank you for your feedback. We hope to incorporate type hints into many more of our classes for the 3.5 release. Jeff - arcpy.mp and Layout teams
... View more
08-29-2024
11:01 AM
|
0
|
0
|
1239
|
| 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 |
a week ago
|