AnsweredAssumed Answered

How to create a feature in a feature class with ArcPy

Question asked by jsn on Apr 23, 2018
Latest reply on Apr 23, 2018 by Dan_Patterson

Hello everyone,


How can I create a point feature in a feature class with ArcPy the same way I do it with

I need to convert this code into Python code.


Dim workspaceEdit As IWorkspaceEdit = CType(myTargetIWorkspace, IWorkspaceEdit)

'' Start an edit session. An undo/redo stack isn't necessary in this case.


''/ Start an edit operation.


Dim feature As IFeature = pFeatureClass.CreateFeature()

feature.Shape = pPoint

feature.Value(feature.Fields.FindField("ID")) = IncidentID

feature.Value(feature.Fields.FindField("ADDRESS")) = Address

feature.Value(feature.Fields.FindField("XCOORD")) = pPoint.X

feature.Value(feature.Fields.FindField("YCOORD")) = pPoint.Y

feature.Value(feature.Fields.FindField("PROBDESC")) = ProblemDescription

feature.Value(feature.Fields.FindField("REQSTDATE")) = DateTime.Parse(RequestedDate.ToString)


''// Save the edit operation. To cancel an edit operation, the AbortEditOperation

''// method can be used.


''// Stop the edit session. The saveEdits parameter indicates the edit session

''// will be committed.