This document is archived and information here might be outdated. Recommended version. |
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*
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.
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");