IDEA
|
This is functionality we would like to provide in the arcpy.mp API but need to overcome a few technical hurdles.
... View more
Tuesday
|
0
|
0
|
79
|
IDEA
|
@FredSpataro there is an ArcGISProject.homeFolder property. In fact when trying to rebuild a project using the techniques above by importing into a blank project, there are many other items to consider. ArcGISProject.databases / updateDatabases ArcGISProject.defaultGeodatabase ArcGISProject.defaultToolbox ArcGISProject.folderConnections / updateFolderConnections ArcGISProjec.homeFolder ArcGISProject.styles / updateStyles (Pro 3.3) ArcGISProject.toolboxes / updateToolboxes (Pro 3.3) ArcGISProject.updateConnectionProperties We are considering creating New Project but there are some technical hurdles we need to resolve. Jeff - arcpy.mp team
... View more
Tuesday
|
0
|
0
|
81
|
IDEA
|
@FourCornersMapping the importDocument method can be found under the ArcGISProject help topic: https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/arcgisproject-class.htm This is not a replacement for your idea, it is a possible workaround for now. Python is great at automation. If you are not familiar with using Python for automation, I understand. The logic will need to be extended further if you want to set {reuse_existing_maps=False} because the object returned is a layout (for import PAGX) so you would need to know how to find the additiona, newly added maps that are also imported and then rename them accordingly. If there is a way to predict the names of the imported maps, then you could reference them and rename them using arcpy.mp. Here is an introductory help topic: https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/introduction-to-arcpy-mp.htm Jeff m = p.listMaps('imported map name')[0]
m.name = "New Name"
... View more
Tuesday
|
0
|
0
|
53
|
IDEA
|
Hello @FourCornersMapping, I can't speak to doing this in the User Interface but this might be automated using Python. For example, p = arcpy.mp.ArcGISProject('current')
newLyt = p.importDocument(r"C:\temp\Layout.pagx", True, True)
newLyt.name = "New Layout" This technique only allows you to rename one object at a time. In the above example, I'm using reuse existing maps = True so if the map already exists, it doesn't get recreated as a project item. The importDocument function can also be used to import mapx and many other file types. Jeff - arcpy.mp and Layout teams
... View more
2 weeks ago
|
0
|
0
|
132
|
IDEA
|
With Pro 3.3, we added applyStyle(style_Item) to all Layout Elements that can be created using styles. This allows you to apply a style to an existing element in a layout. This does NOT include borders, shadows, etc because those properties are not persisted in a style BUT Python CIM access can be used to set these properties. Thanks, Jeff - arcpy.mp and Layout SDK teams
... View more
2 weeks ago
|
0
|
0
|
20
|
IDEA
|
This will be available with Pro 3.3. Layer.createLabelClass(name, expression, {sql_query}, {labelclass_language}) Jeff - arcpy.mp and Layout SDK teams
... View more
2 weeks ago
|
0
|
0
|
22
|
IDEA
|
This will be made available in Pro 3.3. The following members were added to the API: Layer.pageQuery - r/o Layer.setPageQuery({field_name}, {match}) Jeff - arcpy.mp and Layout SDK teams
... View more
2 weeks ago
|
0
|
0
|
13
|
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
2 weeks ago
|
0
|
0
|
26
|
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
3 weeks ago
|
0
|
0
|
131
|
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
4 weeks ago
|
0
|
0
|
209
|
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
|
55
|
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
|
180
|
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
|
138
|
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
|
114
|
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
|
135
|
Title | Kudos | Posted |
---|---|---|
1 | 02-09-2024 03:08 PM | |
1 | 01-23-2024 09:51 AM | |
3 | 12-28-2022 08:44 AM | |
1 | 04-05-2023 07:42 PM | |
1 | 04-21-2021 02:07 PM |
Online Status |
Offline
|
Date Last Visited |
Friday
|