Feature.SetValues

Feature.SetValues method

Sets new values for all of the attributes. Also consider to use CopyValues method to streamline setting values in one call.

public int SetValues(object[] values)
ParameterTypeDescription
valuesObject[]The array of new values.

Return Value

The number of attribute values set.

Exceptions

exceptioncondition
ArgumentNullExceptionArgument cannot be null.
ArgumentExceptionThe attribute with this name does not exist in this layer.
InvalidOperationExceptionThe attribute is not locked.
InvalidCastExceptionThe type of the value does not implement IConvertible.
FormatExceptionConversion failed because the value is in incorrect format.
OverflowExceptionConversion failed because of overflow.

Remarks

This method converts the each value automatically to the type of the attribute. The length of the values array does not need to match the number of attributes in the feature. If the array length is greater than the number of attributes, all of the array values are copied into the attributes; if it is less, only the array length number of values is copied into the attributes, starting at the attribute value with ordinal 0.

See Also