We often work with an aprx project in arcpy (both interactively with a GP tool and from outside session). Sometimes we need to save the project. It would be useful to know the state of the project. Our project live on server and many people may be working with it. Exposing the "isReadOnly" property of the project would be helpful to know if the project is currently locked so that we can decide how we want to proceed. Should I save a copy, move on, throw an error, etc.
e.g.
import arcpy
aprx = arcpy.mp.ArcGISProject({Path or Current})
aprx_state = aprx.isReadOnly
if aprx_state is not True:
aprx.save()
else:
# Do something else here
Note that if you are running this interactively and your aprx object was created with "CURRENT" then isReadOnly would not return True unless the project was opened elsewhere first.
This is something we implemented for ArcGIS Pro 3.1.
Jeff - Layout and arcpy.mp teams
This Idea has been implemented in ArcGIS Pro 3.1. Please see the What's New documentation for more new features in Pro 3.1.
The Ideas in ArcGIS Pro 3.1 blog will be wrapped up soon, highlighting all Ideas implemented in this release, including this one. Once complete, I will add the link to this comment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.