AnsweredAssumed Answered

Problem with calculate field in python

Question asked by JB1234510 on Jan 27, 2015
Latest reply on Jan 28, 2015 by xander_bakker

Somehow I can't manage to get this to work:

The goal is to write a path into a field combined with the attribute Object_ID

 

import arcpy, os
Fgdb = r"R:\Karto\Bierer2014\Datenabgabe\20150113_Brandt\raster\RasterCatalog.gdb"
arcpy.env.workspace = r"R:\Karto\Bierer2014\Datenabgabe\20150113_Brandt\raster\RasterCatalog.gdb"
# Ausgabepfad = (r"R:\Karto\Bierer2014\Datenabgabe\20150113_Brandt\raster").strip()
Ausgabepfad = r"R:\Karto\Bierer2014\Datenabgabe\20150113_Brandt\raster"
ext = ".jpg"
# arcpy.AddField_management(Ausgabepfad + "\Orthos_Nummern.shp", "IMAGE", "TEXT", 100) # , "", "", "refcode", "NULLABLE", "REQUIRED")
# print (Ausgabepfad + "\Orthos_Nummern.shp")
# print ("\"R:\Karto\Bierer2014\Datenabgabe\20150113_Brandt\raster\"" + ext)
# print (Ausgabepfad + "\\Orthos_Nummern.shp")
rows = arcpy.UpdateCursor(Ausgabepfad + "\Orthos_Nummern.shp")  
for row in rows:
    # yield ('"R:\Karto\Bierer2014\Datenabgabe\20150113_Brandt\raster\"' + '(!OBJECT_ID!)' + ext).strip()
    # print (('"R:\Karto\Bierer2014\Datenabgabe\20150113_Brandt\raster\ + '(!OBJECT_ID!)' + 'ext').strip('utf-8'))
    print (('R:\Karto\Bierer2014\Datenabgabe\20150113_Brandt\raster\' + '(!OBJECT_ID!)' + 'ext').strip('utf-8'))
    # arcpy.CalculateField_management(Ausgabepfad + "\\Orthos_Nummern.shp", "IMAGE", 
('"R:\Karto\Bierer2014\Datenabgabe\20150113_Brandt\raster\"' + '(!OBJECT_ID!)' + ext).strip('utf-8'), "PYTHON")

 

???

Outcomes