hadpadmasiri

Question on FieldMapping(arcpy)

Discussion created by hadpadmasiri on Apr 10, 2014
Latest reply on Apr 10, 2014 by Wayne_Whitley
I take an attempt to how fieldmapping is working according to the arcgis desktop help on FieldMapping(arcpy). But it gives me following error. Can you give me a help to solve it.

Thanks

>>> import arcpy
>>> from arcpy import env
>>> env.workspace = r"E:\Gampaha\51027202\CM51027202.gdb\CM51027202"
>>> infc1 = "CNT_PT"
>>> infc2 = "CNT_Anno"
>>> fieldmappings = arcpy.FieldMappings()
>>> fldmap1 = arcpy.FieldMap()
>>> fldmap2 = arcpy.FieldMap()
>>> vt = arcpy.ValueTable()
>>> fieldmappings.addTable(infc1)
>>> fldmap1.addInputField(infc1)

Traceback (most recent call last):
  File "<pyshell#10>", line 1, in <module>
    fldmap1.addInputField(infc1)
  File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\arcobjects\arcobjects.py", line 265, in addInputField
    return convertArcObjectToPythonObject(self._arc_object.AddInputField(*gp_fixargs(args)))
AttributeError: FieldMap: Error in parsing arguments for AddInputField

Outcomes