Error when stop editing a feauture ArcPy

المشرف العام

Administrator
طاقم الإدارة
I'm with another problem with my python code. For an explanation of what I want to do, I wanto to make changes in a feauter attribute table, that's was a edge source of a Network dataset. In next step, I need to rebuild the Network to make the changes take efect.The problem is I open the editor session, make changes in attribute table and when I want to close the session the scrip crashes. The code below is a sample of my code:

import arcpyfrom arcpy import envgdb = r"C:\GDB\NetworkGDB.gdb"env.workspace = gdbenv.overwriteOutput = Trueedt = arcpy.da.Editor(gdb)edt.startEditing(False,False)WHERE = '"OBJECTID_12" = '+row[0]direcao = "yes" #This value was set by another process that's indeppend on this one... Inclusive I tried a fix value like in this examplewith arcpy.da.UpdateCursor("Network_nd_roads",["OBJECTID_12","osm_oneway"], WHERE) as cursor: for lin in cursor: txtLog = "Change value from " + lin[1] + " to " + direcao escreverArquivoLog(logFile,txtLog) #function to write a logfile lin[1] = direcao cursor.updateRow(lin) escreverArquivoLog(logFile,"Change suceed!!!")escreverArquivoLog(logFile,u"Closing edition...")edt.stopEditing(True)#! HERE HAPPENS THE ERROR!!The error is:

File: C:\SCRIPT\Python\OneWayRules.py

Message: RuntimeError: A network source with the specified name don't exist.

ArcPy Message: ERROR 999999: Fail to execute function. User don't have permission to execute the operation. [N_1_Desc] An error happens when executing (BuildNetwork).

But as you can see, I dont call BuildNetwork function yet, I just make changes in the edige source of my Network.Can nayone help me?

Thanks!



أكثر...
 
أعلى