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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.