Select to view content in your preferred language

Expose the isReadOnly property on an aprx object in arcpy.mp

828
2
06-03-2022 10:42 AM
Status: Implemented
Labels (1)
JustinReynolds
Regular Contributor

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.

2 Comments
JeffBarrette
Status changed to: In Product Plan

This is something we implemented for ArcGIS Pro 3.1.

 

Jeff - Layout and arcpy.mp teams

AmeliaBradshaw
Status changed to: Implemented

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.