Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. ISubtypes subtypes = (ISubtypes) targetFC;  // Get subtypes from the target feature class
  2. IFeature newFeature = targetFC.CreateFeature();
  3. if (subtypes.HasSubtype)
  4. {
  5.     // Assign defaults for the subtype
  6.         IRowSubtypes rowSubtypes = (IRowSubtypes)newFeature;
  7.         rowSubtypes.SubtypeCode = subtypes.DefaultSubtypeCode;
  8.         rowSubtypes.InitDefaultValues();
  9.         newFeature.Store();
  10. }
  11. else
  12. {
  13.         // Assign defaults for the feature
  14.         IRowSubtypes rowSubtypes = (IRowSubtypes)newFeature;
  15.         rowSubtypes.InitDefaultValues();
  16.         newFeature.Store();
  17. }