Select to view content in your preferred language

Calculate Geometry Attributes ArcPro 2.2

4129
20
06-28-2018 07:52 AM
AileenProfir
New Contributor III

Hi,

I'm trying to use the  'Calculate Geometry' tool (selected by right-clicking a field in the attribute table) to calculate XY coordinates for a point and have also tried to calculate square miles for a polygon feature. I am getting a "RuntimeError: Objects in this class cannot be updated outside an edit session".  It was my understanding that edit sessions are automatic in ArcPro.  How would I go about starting an edit session?

Thanks for your help,

Aileen

0 Kudos
20 Replies
KimberlyGraham1
New Contributor III

Hey Drew - I get the same error - versioned feature classes - SQL 2012

Pieter_Geertvan_den_Beukel
Esri Contributor

Hello Drew,

Same error here on ArcGIS Pro 2.2 with Oracle 12.10.2

1. Created polygon feature class and draw some polygons

2. Added a field (double) and right-clicked for Calculate Geometry -> Worked

3. Register as versioned

4. Added a new field (double) and did another Calculate Geometry -> Error "RuntimeError: Objects in this class cannot be updated outside an edit session"

5. Tried the previous field: same error.

6. Reopened ArcGIS Pro, Calculate Geometry -> Same error

7. Unregister as versioned

8. Calculate Geometry: Worked

DrewFlater
Esri Regular Contributor

Just to clarify on the original question, starting an edit session manually wouldn't make the tool start to work. The tool uses arcpy.da cursors to calculate the geometry properties into the field, and these cursors need to work within an arcpy.da.Editor block in some cases. This logic is already in the tool, so I'm not sure what's going wrong with the logic, but would appreciate if you can contact tech support as soon as possible so we can start fixing the bug.

Thanks

ThomasColson
MVP Frequent Contributor

SDE 10.6 SQL 2014 ENT, FC Storage type is Geography. I'll try to get a video going....

0 Kudos
ThomasColson
MVP Frequent Contributor

BUG-000115460 Calculate Geometry fails with certain types of enterprise geodatabases, SDE, and database versions (plus versioned classes) is fixed in 2.2.1 Release notes for ArcGIS Pro 2.2—ArcGIS Pro | ArcGIS Desktop I know Drew Flater‌ put a lot of elbow grease into getting this fixed!

MichaelVolz
Esteemed Contributor

Can someone from ESRI be more specific with the below statement from the Release Notes alluded to above:

Calculate Geometry fails with certain types of enterprise geodatabases, SDE, and database versions (plus versioned classes).

What versions of Oracle does this bug apply to?

Does this bug include file gdbs?

0 Kudos
DrewFlater
Esri Regular Contributor

The bug was not reported and was never experienced with file geodatabase.

I believe any Oracle enterprise geodatabase version would be impacted, thought all the known cases have been addressed in 2.2.1. 

ThomasTricot
New Contributor II

You need to change something.  Edit something.  Once you click "Save", the edit session is considered ended.  Just alter something in your feature, don't click save, then go through the calculate geometry process.  It will work.

MichaelVolz
Esteemed Contributor

Thomas:

What version of Pro are you testing on?  What type of enterprise GDB are you using (e.g. SQL Server, Oracle, other)?

0 Kudos
ThomasTricot
New Contributor II

ArcGIS Pro 2.2.4

SQL Server 2014

0 Kudos