|
IDEA
|
Add ArcGISProject.closeViews() at 3.0. Jeff - Layout and arcpy.mp teams
... View more
08-12-2022
09:49 AM
|
0
|
0
|
4107
|
|
IDEA
|
Hello everyone and thank you for your feedback! I missed this thread because it wasn't labelled arcpy.mp. We exposed Python CIM Access to be able to accommodate these finer grained requests. Please review this topic: https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/python-cim-access.htm You should be able to accomplish now using arcpy.mp and CIM access. Also in the pipeline on the Layout team (post 3.1) that you might find useful is we plan on adding scale thresholds to layout map surrounds elements so, for example, you can have multiple, stacked scalebars with different settings, scale will control visibility and if you sent the thresholds up correctly, just one scale bar would display at a time. As for arcpy, here is a script from a downloadable sample that has 30 CIM snippets. I modified it slightly to also update divisions and subdivisions I saw mentioned in the thread. Here is a before and after scale bar. Code sample: p = arcpy.mp.ArcGISProject('current') lyt = p.listLayouts('GreatLakes')[0] lyt_cim = lyt.getDefinition("V2") #Get the layout's CIM definition #Iterate though all layout elements to find the ScaleBar element for elm in lyt_cim.elements: if elm.name == "Scale Bar": #Change the number of divisions and subdivision elm.divisions = 3 elm.subdivisions = 2 #Flip the scale bar so markers and labels appear below the line elm.labelPosition = "Below" elm.markPosition = "Below" #Remove the first midpoint division label by labeling only divisions elm.labelFrequency = "Divisions" lyt.setDefinition(lyt_cim) #Set the layout's CIM definition The CIM samples can be located here: https://esriurl.com/arcpy.mp/samples Then scroll to the one called CIM Samples
... View more
08-12-2022
08:22 AM
|
0
|
0
|
3763
|
|
POST
|
Hello, The X/Y Min/Max values represent a rectangle like you suggest. Rectangles are just one way of controlling extent and are not always the best. For example, if the data in a map frame is rotated, the extent that gets returned will not match what you see in the UI because a rotated rectangle has a larger extent. There are other techniques for zooming to a layer, selected features in a layer, etc. Check out the first sample located in the MapFrame help topic. The same logic will work with a MapView. The second parameter is to use the layers's selection. if False, use all features, if True, use selection. So you can first perform a SelectLayerByAttributes or ByLocation to create a selection and then use the selection to control your zoom level. mf.camera.setExtent(mf.getLayerExtent(lyr, False, True)) https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/mapframe-class.htm
... View more
08-11-2022
10:21 AM
|
0
|
0
|
4048
|
|
IDEA
|
Given you can use importDocument(path to mapx), change data sources, then export back to mapx, this lessens the priority of creating additional classes and members given a fair amount of other planned development work. If the above workflow does NOT work for you, please describe in detail you scenario and we could reconsider. Jeff - Layout and arcpy.mp teams
... View more
08-10-2022
02:40 PM
|
0
|
0
|
2839
|
|
IDEA
|
Thank you for your feedback. There is a long answer to this. First, the Layout team is developing commands for 3.1 that allow you to resize a layout AND have an option to scale layout elements proportionally. The same resize boolean is available to copying a layout. Second, arcpy.mp (NOT arcpy.mapping in ArcMap) is also being expanded. At 3.1 we are adding content management functions to copy project items like maps, layouts, and reports. This allows you to make a copy and then automate changes to the copy. arcpy.mp already allow you to change the page size - the problem is that is does NOT automatically resize elements. That option can't come until after the Layout commands are completed. At 3.1 arcpy.mp is also adding the ability to CREATE new maps but NOT layouts (yet). That is because arcpy.mp traditionally doesn't allow you to create new objects so why create a layout when you can't create things like map frames, scalebars, etc. This is definitely something we want to get to longer term. Jeff - Layout and arcpy.mp teams
... View more
08-10-2022
07:54 AM
|
0
|
0
|
5129
|
|
IDEA
|
This has been added to Pro 3.1 Import MXD (include_layout=True) returns the Layout object ImportMXD (include_layout=False) returns first Map Import3DD, SDX returns Map ImportPAGX - Layout, ImportRPTX - Report, ImportMAPX - Map Jeff - Layout and arcpy.mp teams
... View more
07-29-2022
09:05 AM
|
0
|
0
|
3095
|
|
POST
|
Hello, "TheBobScript" I tried to reproduce your code in 2.9 and 3.0 and was uncesscessful. When I run your code above, everything gets created in less than a second. There was a compile error with your sample above. I made a very slight modification to make it work. I have no idea if that is the difference. If you have different or more complete code, it may be necessary to reproduce the issue. Here is the code modification I used to replace your lines 30-34 above. for (int i = 0; i < 100; i++) { MapPoint mapPt = MapPointBuilderEx.CreateMapPoint(i, i); graphics.Add(new CIMTextGraphic() { Shape = mapPt, Symbol = new CIMSymbolReference() { Symbol = SymbolFactory.Instance.ConstructTextSymbol(ColorFactory.Instance.BlackRGB, 6, "Arial Narrow", "Regular") }, Text = i.ToString() }); names.Add($"Point{i}"); } Jeff - Layout and arcpy.mp teams
... View more
07-26-2022
01:44 PM
|
0
|
0
|
1206
|
|
IDEA
|
Closed pending response. We can re-assess once we have more information" Jeff - Layout and arcpy.mp teams
... View more
07-26-2022
10:14 AM
|
0
|
0
|
3023
|
|
IDEA
|
We can NOT implement this idea with arcpy/arcpy.mp. Creating a new project requires a "restart" and because Python gets loaded after the project is being opened, its a bit of a catch-22. For a similar reason, there are some project options that can't be changed using arcpy.mp because the project needs to be restarted after a change is made. Jeff - arcpy.mp and Layout teams.
... View more
07-08-2022
03:10 PM
|
0
|
0
|
6834
|
|
POST
|
Hello @cchen27 , I can not reproduce this issue on Pro 3.0. I tried with the Python window and a Notebook. It is very important you submit this issue into support. It must be a unique situation that needs to be diagnosed. Things to try: You mentioned an old notebook. Can you run the same code in a new notebook? Does it hang on printing any layout name or a specific one? Could it be a special character in the name? If we can get a project package that includes your notebook, that would be most helpful. Thanks, Jeff - arcpy.mp and Layout teams.
... View more
07-01-2022
06:09 AM
|
0
|
0
|
1559
|
|
IDEA
|
Hi Brett, I can not reproduce this either as in-process (i.e., 'current') or as a stand-alone script. I tested 2.9 and 3.0. Can you still reproduce? If you still can, did you try the GP env setting OverWriteOuput? Here is a simple script that works. And it works if I close and reopen and/or run again. import arcpy p = arcpy.mp.ArcGISProject(r"C:\temp\GreatLakes\GreatLakes.aprx") #or 'current' lyt = p.listLayouts('Layout')[0] lyt.exportToPAGX(r"C:\Temp\Layout.pagx") lyt.exportToPAGX(r"C:\Temp\Layout.pagx") lyt.exportToPAGX(r"C:\Temp\Layout2.pagx") lyt.exportToPAGX(r"C:\Temp\Layout3.pagx")
... View more
06-21-2022
12:56 PM
|
0
|
0
|
3049
|
|
IDEA
|
Does ArcGISProject.ImportDocument() satisfy your needs? It allows you to import mapx, pagx and more into a project? We also support exporting to these formats. Or do you want to be able to connect to a pagx or mapx and repair datasources directly on those? A work around would be to importDocument into a project, change datasources and then export back to the appropriate X file. Jeff - arcpy.mp and Layout teams.
... View more
06-21-2022
12:29 PM
|
0
|
0
|
2865
|
|
IDEA
|
This has been implemented in ArcGIS Pro (arcpy.mp) for a while. Changes will not be made to the arcpy.mapping API. https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/layer-class.htm See specifically: Layer.getSelectionSet() Layer.setSelectionSet({oidList}, [{method})
... View more
06-21-2022
12:24 PM
|
0
|
0
|
3008
|
|
IDEA
|
@cwh if you simply want to close map, layout "VIEWS", it can be done using Pro 3.0. We added a new ArcGISProject.closeViews() function and this will address your needs. We also added Map/Layout.openView() At 3.1, we are adding the ability to remove Project Items. This includes Maps, Layouts, and Reports. If you are satisfied with only closing views, then we can close this idea. If you are also interested in removing project items, then we can keep this open and I'll mark it appropriately. Jeff - arcpy.mp and Layout teams
... View more
06-21-2022
12:13 PM
|
0
|
0
|
4176
|
|
IDEA
|
Thank you for submitting this idea. We plan to implement this near term. Jeff - arcpy.mp and Layout teams
... View more
06-21-2022
11:46 AM
|
0
|
0
|
2556
|
| 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
|