Skip to main content
Solved

Adding a new field to an existing Feature Class

  • September 7, 2017
  • 4 replies
  • 176 views

canerakin
Contributor
Forum|alt.badge.img+5

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:

Best answer by takashi

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.

View original
Did this help you find an answer to your question?

4 replies

erik_jan
Contributor
Forum|alt.badge.img+17
  • Contributor
  • September 7, 2017

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).


canerakin
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • September 7, 2017
erik_jan wrote:

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

 

 


erik_jan
Contributor
Forum|alt.badge.img+17
  • Contributor
  • September 7, 2017
canerakin wrote:
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).

 

 


takashi
Influencer
  • Best Answer
  • September 7, 2017

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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings