Dear all,
I want to check whether I can determine the geometry type of the new created feature, is it a point, polyline or polygon?
I am using vb.net and arcmap 10.2.1, thanks.
Hi,
so you're looking for a way to run code each time a new feature is created in an edit-session ? This can be done by using Editor-events (see "ArcGIS Desktop editing for developers" in the online help): the editor object that handles editing tasks in ArcMap owns an event "OnCreateFeature" where you can react on new features inserted by the user.
I hope this helps you and meets your needs. Otherwise please give some more informations about the workflow you want to support.
Frank
Hi Frank,
I am creating feature in arcmap, not arcobjects.
Sorry - "CreateFeatureOfUnknownType" is no existing function, it's a placeholder in this example for the function you are using to create your feature.
Thank you Frank for the quick reply.
I convert the code you provided to vb.net and insert into my vb.net project.
But I get an error:
'CreateFeatureOfUnknownType' is not declared. Is there any library need to import?
you could check the GeometryType of the Shape-property of IFeature:
IFeature feature = CreateFeatureOfUnknownType();
//do some null-checks here
//then
switch(feature.Shape.GeometryType)
{
case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolygon:
//blah
break;
case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolyline:
//blahblah
//etc
}
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.