Solved

Adding a new field to an existing Feature Class

  • 7 September 2017
  • 4 replies
  • 63 views

Badge +4

I am trying to add a new attribute to a feature class in CMDM Geodatabase. This attribute is going to be FEATID, I tried to use AttributeManager, and the user attributes in writer properties but none of them worked. I tried to use PythonCaller with the code below but I could not get any result:

 

----------------------------------

import arcpy

RoadCentreline = "C:\\Users\\akinc\\Desktop\\dellMe\\CMDM2.3.3.gdb\\ReferenceData\\RoadCentreline"

Add Field arcpy.AddField_management(RoadCentreline, "featID", "LONG", "", "", "", "", "NULLABLE", "NON_REQUIRED", "") ----------------------------------- This is the workbench:

icon

Best answer by takashi 7 September 2017, 23:52

View original

4 replies

Userlevel 2
Badge +16

I believe there to be 2 ways of doing this:

If you overwrite the output GDB or Drop the table for the next run, you can manually add the field to the output feature type (Set to Manual on the User attributes tab and hit the + at the bottom).

If the GDB can not be overwritten, you will need to use ArcGIS to add the field to the table and the update the feature class (manually as described above or using the Witers > Update Feature Types menu).

Badge +4

I believe there to be 2 ways of doing this:

If you overwrite the output GDB or Drop the table for the next run, you can manually add the field to the output feature type (Set to Manual on the User attributes tab and hit the + at the bottom).

If the GDB can not be overwritten, you will need to use ArcGIS to add the field to the table and the update the feature class (manually as described above or using the Witers > Update Feature Types menu).

Actually i did add the field from ArcGIS, I do not want to drop the table. So that`s why I tried to write the python script above. Is there any way to use this code in pythonCaller? When I copy and paste this code to pythonCaller, it doesnt work

 

 

Userlevel 2
Badge +16
Actually i did add the field from ArcGIS, I do not want to drop the table. So that`s why I tried to write the python script above. Is there any way to use this code in pythonCaller? When I copy and paste this code to pythonCaller, it doesnt work

 

 

Have you tried adding the field in the feature type. That only matches the definition in FME with the definition in the GDB. It does not change the GDB if you do not drop the table from FME (setting).

 

 

Userlevel 2
Badge +17

Hi @canerakin111, I think it would be quickest to use ArcGIS, but if you need to do it with FME anyway, it would be better to run the script as Startup Python Script, rather than a PythonCaller.

Reply