Routines (alphabetical) > Routines: H > HDF Routines > HDF_GR_GETATTR

# HDF_GR_GETATTR

This function obtains all values of the HDF GR attribute that is specified by its index, attr_index, and is attached to the object identified by the parameter obj_id.

## Syntax

Result = HDF_GR_GETATTR(obj_id, attr_index, values)

## Return Value

Returns SUCCEED (0) if successful or FAIL (-1) otherwise.

## Arguments

### obj_id

Raster image identifier (ri_id), returned by HDF_GR_CREATE or HDF_GR_SELECT, or HDF GR interface identifier (gr_id), returned by HDF_GR_START.

### attr_index

Index of the attribute.

The value of the parameter attr_index can be obtained by using HDF_GR_FINDATTR, HDF_GR_NAMETOINDEX, or HDF_GR_REFTOINDEX, depending on available information. Valid values of attr_index range from 0 to the total number of attributes of the object - 1. The total number of attributes attached to the file can be obtained using the routine HDF_GR_FILEINFO. The total number of attributes attached to the image can be obtained using the routine HDF_GR_GETIMINFO. HDF_GR_GETATTR only reads all values assigned to the attribute and not a subset.

### values

A named variable that will contain the attribute values.

## Keywords

None

## Version History

5.2 | Introduced