Error using insert cursor (da) with featureclass in a geometric network

3393
8
10-13-2015 12:46 PM
CallumSmith
New Contributor III

Hi

I am got an issue where I am trying to insert features into a feature class that participates in a geometric network.

Firstly I guess the question is "Is this even possible?"

When I try to insert a record into the featureclass I am getting this error: SystemError('error return without exception set',)

If I remove the geometric network or use the code on another feature class that does not participate in a geometric network it works fine. I cannot however remove the geometric network from the production database.

If anybody has any ideas on this issue that would be appreciated.

cheers

Callum

0 Kudos
8 Replies
DanPatterson_Retired
MVP Emeritus

From here...

This statement

The following includes some dataset types that can only be edited within an edit session:

  • Feature classes participating in a topology
  • Feature classes participating in a geometric network
  • Versioned datasets in enterprise geodatabases
  • Some object and feature classes with class extensions

But I have not clue if it applies to your situation.

0 Kudos
NeilAyres
MVP Alum

Recently completed a tool to update / insert into a Network Dataset. I can confirm that you need a edit session open.

DanPatterson_Retired
MVP Emeritus

Good to know...I wish you could make notes in the margins of the online help

CallumSmith
New Contributor III

Thanks Neil

I do have an edit session open as the featureclass is also in a versioned enterprise geodatabase.

In my testing I have copied the data to a file gdb and it still does not work. If I remove the geometric network the it does work???

cheers

Callum

0 Kudos
CallumSmith
New Contributor III

Thanks Dan

Yes I do have an edit session open as the featureclass participates in a geometric network and is also versioned.

Not sure why it is failing as the error message is not very helpful!!

cheers

Callum

0 Kudos
ModyBuchbinder
Esri Regular Contributor

Hi

I did not tried it but you can start edit in ArcMap and run your script in the python window.

Maybe it will work...

Have Fun

0 Kudos
CallumSmith
New Contributor III

Yes I have tried running the script from a tool within arcmap and it still gives me the same issue.

cheers

Callum

0 Kudos
JohnPlunkett
Esri Contributor

As Callum pointed out to me in a separate email it looks like its a bug.

Bug NIM-102778

Synopsis

The insertRow method of arcpy.da.InsertCursor fails when working with data in a geometric network.

Additional Information

N/A

Alternate Solution

The Append tool works fine for features participating in a geometric network.

1. Fill an empty feature class outside the geometric network with records using an insert cursor.
2. Use the Append tool to add the records to the feature class in the geometric network.

http://support.esri.com/en/bugs/nimbus/TklNMTAyNzc4