IDLffShape::SetAttributes

The IDLffShape::SetAttributes procedure method sets the attributes for a specified entity in a Shapefile object.

Syntax

Obj->[IDLffShape::]SetAttributes, Index, Attribute_Num, Value

or

Obj->[IDLffShape::]SetAttributes, Index, AttributeStruct

Arguments

Index

A scalar or array of integers specifying the entity in which you want to set the attributes. If Index is a scalar, then it specifies the starting point at which to start writing the attributes as given by the Value argument. If Index is an array with the same number of elements as Value, then Index specifies the indices of the attributes to write. When writing new attributes, the attributes must be written in order, starting at index 0, with no gaps. When overwriting existing attributes, the attributes may be written in any order.

Attribute_Num

The field number in the attribute structure for the attribute whose value is being set. This value is 0-based.

Value

If Attribute_Num is present, then Value is the value (or array of values) of the field within the attribute. If the value is not of the correct type, type conversion is attempted.

AttributeStruct

An Attribute structure whose fields match the fields in the attribute table. If AttributeStruct is an array, the entities specified in Index, up to the size of the Attributes array, are set. Using this feature, all the attribute values of a set of entities can be set for a Shapefile.

The type of this Attribute structure must match the type that is generated internally for Attribute table. To get a copy of this structure, either get the attribute set for an entity or get the definition using the ATTRIBUTE_STRUCTURE keyword of the IDLffShape::GetAttributes method.

Keywords

None

Examples

For an example of SetAttributes, see Creating New Shapefiles. In this example you will create a new shapefile, define the attributes for the new file, define a new entity, define some attributes, insert the new entity, and then use the SetAttributes method to insert the attributes into the new file.

Version History

5.4

Introduced