Routines (alphabetical) > Object Classes > File Format Object Classes > IDLffShape::SetAttributes

# IDLffShape::SetAttribute

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, Value

## Arguments

### Attribute_Num

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

### Attributes

An Attribute structure whose fields match the fields in the attribute table. If Attributes 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::GetProperty method.

### 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.

### 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.

If Attribute_Num is not present, then Value is an Attribute structure (or array of structures) whose fields match the fields in the attribute table. 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::GetProperty method. If Value is an array, the attributes specified in Index are set. Using this feature, all the attribute values of a set of entities can be set for a Shapefile.

## 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