public static void CreateFeature(IFeatureClass featureClass, IPolyline polyline) { // Build the feature. IFeature feature = featureClass.CreateFeature(); feature.Shape = polyline; // Apply the appropriate subtype to the feature. ISubtypes subtypes = (ISubtypes)featureClass; IRowSubtypes rowSubtypes = (IRowSubtypes)feature; if (subtypes.HasSubtype) { // In this example, the value of 3 represents the PVC subtype. rowSubtypes.SubtypeCode = 3; } // Initialize any default values the feature has. rowSubtypes.InitDefaultValues(); // Update the value on a string field that indicates who installed the feature. int contractorFieldIndex = featureClass.FindField("CONTRACTOR"); feature.set_Value(contractorFieldIndex, "K Johnston"); // Commit the new feature to the geodatabase. feature.Store(); }
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.