This document is archived and information here might be outdated.  Recommended version.


IEditTemplate.SetDefaultValues Method (ArcObjects .NET 10.6 SDK)
ArcObjects Library Reference (Carto)  

IEditTemplate.SetDefaultValues Method

Sets the default values on the given feature.

[Visual Basic .NET]
Public Sub SetDefaultValues ( _
    ByVal Feature As IFeature _
)
[C#]
public void SetDefaultValues (
    IFeature Feature
);
[C++]
HRESULT SetDefaultValues(
  IFeature* Feature
);
[C++]

Parameters Feature [in]
Feature is a parameter of type IFeature*

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Remarks

This method populates the fields of an IFeature with the default values of the current template. It is used to populate the fields of a feature that may have been created programmatically.

[C#]

IEditTemplate pET=m_editor.CurrentTemplate;
IFeatureLayer pFL=pET.Layer as IFeatureLayer;
IFeatureClass pFC=pFL.FeatureClass;

IFeature pfeature=pFC.CreateFeature();
pfeature.Shape=pPoly;
pET.SetDefaultValues(pfeature);
m_editor.StartOperation();
pfeature.Store();
m_editor.StopOperation("Create Poly");

See Also

IEditTemplate Interface

.NET Samples

Points along line construction tool (Code Files: PointsAlongLineForm)