Advertisement
edblair

SetDefaultValues

Oct 5th, 2014
382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.58 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement