POST
|
To provide a final update. I've decided to set enabled = False for the 'Open Project' parameter. If in the future, a solution comes around for this read only issue I can change it back to true. The users will be instructed to do all their project creation in Project A then to close Project A before opening any of the projects to do any work on them. Thanks.
... View more
3 weeks ago
|
0
|
0
|
59
|
POST
|
It may turn out that the simplest solution may be to as you said Dan, have the user create all of their projects from Project A, have the script open none of them (even remove that parameter from the form). Then when done creating projects, close Project A and then the user can open the others to work on and there should be no issue.
... View more
3 weeks ago
|
0
|
0
|
77
|
POST
|
So after much testing I have narrowed the issue down to the following procedure: def ExportImage(prj, mapName, lyrExtent, lytName, mapScale, pngFilePath):
if prj == 'current':
aprx = arcpy.mp.ArcGISProject('current')
else:
aprx = arcpy.mp.ArcGISProject(prj)
m = aprx.listMaps(mapName)[0]
lyr = m.listLayers(lyrExtent)[0]
lyt = aprx.listLayouts(lytName)[0]
mf = lyt.listElements("mapframe_element", "Map Frame")[0]
mf.camera.setExtent(mf.getLayerExtent(lyr, False, True))
mf.camera.scale = mapScale
lyt.exportToPNG(pngFilePath, resolution=300, color_mode = '8-BIT_ADAPTIVE_PALETTE')
del aprx and specifically these lines: m = aprx.listMaps(mapName)[0]
lyr = m.listLayers(lyrExtent)[0] I'm at a bit of a loss as to why this is happening. I do use these lines of code in other procedures without issue. Trying: del lyr
del m makes no difference. I suppose I could remove this whole 'Create Images' part from this program and have the user run 'Create Image' once Project B has opened (in write mode). But it would be really nice to figure out what the issue here is.
... View more
3 weeks ago
|
0
|
0
|
86
|
POST
|
Thanks Dan. Ya, both file and enterprise. I'm currently stepping through the program trying to narrow down which procedure is creating the lock. More to come...
... View more
3 weeks ago
|
0
|
0
|
107
|
POST
|
Hello everyone, I have a process I am developing which uses one project ("Project A.aprx") to create then optionally open another project ("Project B.aprx"). The user opens Project A, selects a parcel then runs a script. The script will create a new folder on the network for Project B, then it will extract a project template file (.aptx) into the folder. It will continue on doing a number of other processes and then at the end it will either open Project B (or not) based on whether or not the user selected the checkbox on the initial script form to open the project. Irregardless of whether or not the 'Open Project' is checked (i.e. the script opens Project B or the user opens Project B) when Project B opens it opens as Read Only. This is the case as long as Project A is still open. If the user closes Project A and then opens Project B it will open in write mode (which is what I want). Possible Solutions: 1. Can the script close Project A after initiating opening Project B? I'm not sure if this is possible with arcpy (I'm betting not). But I'd rather not do this as the user may want to keep Project A open and create a Project C, D, E... after creating Project B. 2. Figure out what's happening on the Project A side of things that it's locking Project B and preventing it from opening in write mode. This is what I'd really like to figure out. I'm using ArcGIS Pro 2.6.3 but have tested this in 2.4.3 and 2.7 and there's no difference. Any ideas/insights much appreciated. Thanks All!
... View more
3 weeks ago
|
0
|
5
|
126
|
IDEA
|
Hi @JeffBarrette I want to be able to remove/delete mapview and layout from the project. In my use case the "seed project" has one layout associated with each mapview. So if a application type is chosen that does not use all mapview (for example application type 'Development Permit' does not have a Proposed Use, so I would want to use arcpy to remove the Proposed Use Mapview and Proposed Use Layout. Thanks, Chris
... View more
11-25-2020
11:42 AM
|
0
|
0
|
167
|
IDEA
|
I would like to be able to remove mapviews and layouts using arcpy. To me this seems like something arcpy should have the ability to do. To provide a simple use case. I have a python toolbox which is used to create/setup new arcgis pro projects for planning applications. The toolbox uses a 'seed project' as the base for creating the new project. The seed project has all mapviews/layouts that could be used by all application types. But some application types do not use all mapviews/layouts. This is why for us it would be helpful if there was a way with arcpy to remove mapviews/layouts which are not needed for certain application types. Thanks!
... View more
11-25-2020
07:47 AM
|
0
|
3
|
189
|
Online Status |
Offline
|
Date Last Visited |
3 weeks ago
|