|
IDEA
|
@ted At Pro 3.3 we added createTableFrameElement and a new TableFrameElement class. I hope this helps with your requirements for "adding a table to a layout". Jeff - arcpy mp and Layout SDK teams
... View more
04-10-2024
11:24 AM
|
0
|
0
|
1314
|
|
IDEA
|
@-_- can you please explain how you are importing? I added the last two lines to the sample code I originally made available to see if writing to LYRX was losing its value. For me, its working as expected. #In this example, the first class break range is "62127 - 824344"
#The minimumBreak value is changed to "60000" via Python CIM Access
#BUT ... the label also needs to be updated to "60000 - 824344
p = arcpy.mp.ArcGISProject('current')
m = p.listMaps('Map')[0]
l = m.listLayers('State_Polygons')[0]
#Update mimimumBreak value via Python CIM Access
if hasattr(l.symbology, 'renderer'):
if l.symbology.renderer.type == 'GraduatedColorsRenderer':
l_cim = l.getDefinition('V3')
l_cim.renderer.minimumBreak = 60000
l.setDefinition(l_cim)
#Update the label to match the new value is seen via Histogram tab
sym = l.symbology
cb1 = sym.renderer.classBreaks[0]
cb1Lbl = cb1.label
update = cb1Lbl.replace(cb1Lbl.split('-')[0], str(l_cim.renderer.minimumBreak) + ' ' )
cb1.label = update
l.symbology = sym
#Test if values are persisted when saving to a LYRX
l.saveACopy(r'c:\Temp\MinValue.lyrx')
m.addDataFromPath(r'c:\Temp\MinValue.lyrx') #Min value is persisted Then I ran this as another way to test persistence. #Test values can be applied to other layers.
l1 = m.listLayers('Original')[0] #Made a copy prior to running script above
l2 = m.listLayers('State_Polygons')[0]
l1.symbology = l2.symbology Is it possible it is layer type or data specific? Jeff
... View more
04-04-2024
02:50 PM
|
0
|
0
|
2627
|
|
IDEA
|
Thank you for your feedback, @-_- This can be accomplished via Python CIM access: https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/python-cim-access.htm In addition to changing the CIM minimumBreak value, you also need to change the label for the first class break to include your modified value. Here is a code snippet: #In this example, the first class break range is "62127 - 824344"
#The minimumBreak value is changed to "60000" via Python CIM Access
#BUT ... the label also needs to be updated to "60000 - 824344
p = arcpy.mp.ArcGISProject('current')
m = p.listMaps('Map')[0]
l = m.listLayers('State_Polygons')[0]
#Update mimimumBreak value via Python CIM Access
if hasattr(l.symbology, 'renderer'):
if l.symbology.renderer.type == 'GraduatedColorsRenderer':
l_cim = l.getDefinition('V3')
l_cim.renderer.minimumBreak = 60000
l.setDefinition(l_cim)
#Update the label to match the new value is seen via Histogram tab
sym = l.symbology
cb1 = sym.renderer.classBreaks[0]
cb1Lbl = cb1.label
update = cb1Lbl.replace(cb1Lbl.split('-')[0], str(l_cim.renderer.minimumBreak) + ' ' )
cb1.label = update
l.symbology = sym Jeff - Layout (SDK) and arcpy.mp teams
... View more
03-27-2024
04:57 PM
|
0
|
0
|
2705
|
|
IDEA
|
This is planned for ArcGIS Pro 3.3. Jeff - Layout SDK and arcpy.mp teams
... View more
03-01-2024
07:40 AM
|
0
|
0
|
1036
|
|
IDEA
|
@sadlkjiouasdf try ArcGISProject.deleteItem(project_item) https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/arcgisproject-class.htm Jeff - Layout SDK and arcpy.mp teams
... View more
02-26-2024
02:38 PM
|
0
|
0
|
2180
|
|
IDEA
|
This will be introduced in Pro 3.3. Layout.createTableFrameElement(geometry, {mapframe}, {table}, {fields}, {style_item}, {name}) There will also be a TableFrame class Jeff - Layout and arcpy.mp teams.
... View more
02-26-2024
12:28 PM
|
0
|
0
|
1249
|
|
POST
|
Yes, this was added at Pro 3.2. See: https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/map-class.htm Jeff - Layout arcpy.mp teams
... View more
02-26-2024
08:18 AM
|
0
|
0
|
2337
|
|
POST
|
@Asimov I was able to reproduce on Pro 3.1 but NOT on Pro 3.2 (and even Pro 3.3). Would you be able to test this against 3.2? Jeff - Layout (SDK) and arcpy.mp teams.
... View more
02-09-2024
03:08 PM
|
1
|
2
|
1271
|
|
POST
|
@JohnFixCai prior to Pro 3.2, you had to pass in the full, explicit basemap name string the way it appears in the gallery. It is sometimes confusing because what you see in the gallery is different than what you see in the TOC. For example In the Gallery you see 'Colored Pencil Map' but when it is added, you see 'Colored Pencil' in the TOC. The listBasemaps function allows you to use a wildcard (e.g., 'Color*') instead of the full string. So in your case, you could use Map.addBasemap('Colored Pencil Map') Jeff - Layout arcpy.mp team
... View more
02-08-2024
01:15 PM
|
0
|
0
|
2292
|
|
POST
|
This is unfortunately a known limitation (BUG-000121293). The pdf libraries available in ArcMap were outdated and we needed to adopt a newer solution - we chose Py2PDF2. The community is aware of the limitation and we are hopeful the developers will address it. In the meantime, you would need to append the pages using an Adobe product. Jeff - Layout and arcpy.mp teams
... View more
01-23-2024
09:51 AM
|
1
|
0
|
1114
|
|
IDEA
|
This should be available with Pro 3.3. Layout.changePageSize(page_width, page_height, {resize_elements=True}) Jeff - Layout and arcpy.mp teams
... View more
12-27-2023
01:44 PM
|
0
|
0
|
3283
|
|
IDEA
|
@MErikReedAugusta Python CIM Access is a way to get to properties we don't expose to our curated API. We expose focused capabilities and use the CIM for the less common features. Review the help topic to get a better understanding and please let me know if this helped. I'll mark the topic as "already offered". Jeff - Layout and arcpy.mp teams
... View more
12-21-2023
08:40 AM
|
0
|
0
|
1141
|
|
IDEA
|
@MErikReedAugusta have you tried using Python CIM Access I just tried quickly with the following code: p = arcpy.mp.ArcGISProject('current')
m = p.listMaps()[0]
l = m.listLayers('Photo0')[0]
l_cim = l.getDefinition('V3')
l_cim.l_cim.blendingMode = 'Multiply' #Was Normal
l.setDefinition(l_cim) Jeff - Layout and arcpy.mp teams
... View more
12-20-2023
11:14 AM
|
0
|
0
|
1205
|
|
IDEA
|
@KevinDonahue3 the above script does duplicate/copy the layout (including the map series setup), the difference is that each newly saved layout has the correct extent for each page based on the map series index feature. If your preference is to NOT have a map series at part of the layout, then you can disable it. I slightly modified the code above to do that. Now when you open each newly copied layout, the map series is disable. import arcpy, os
p = arcpy.mp.ArcGISProject(r"C:\temp\GreatLakes\GreatLakes.aprx")
l = p.listLayouts('*_MS*')[0]
if not l.mapSeries is None:
ms = l.mapSeries
if ms.enabled:
for pageNum in range(1, ms.pageCount + 1):
ms.currentPageNumber = pageNum
pageName = ms.pageRow.NAME
print(f"Copying {pageName} to new layout")
cpLyt = p.copyItem(l, pageName)
cpLyt.mapSeries.enabled = False
p.saveACopy(r"C:\temp\GreatLakes\GreatLakes_MSPages2Layouts.aprx")
os.startfile(r"C:\temp\GreatLakes\GreatLakes_MSPages2Layouts.aprx") Does this do what you need? Jeff - arcpy.mp and Layout teams
... View more
12-05-2023
10:22 AM
|
0
|
0
|
5332
|
|
POST
|
If you use a wildcard value, you must match the layout name exactly. It is case sensitive. You can also use an * in the wildcard. For example if I have a layout called 'Great Lakes' I can so stuff like: lyt = p.listLayouts('Great*)[0] lyt = p.listLayouts('*akes')[0] lyt = p.listLayouts('*eat*')[0]
... View more
11-20-2023
07:33 AM
|
0
|
0
|
2682
|
| 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
|