sdaiGetAttrBN


Returns the data value in the specified attribute in the actual instance. The actual instance is specified by a numeric instanceID that uniquely identifies an instance in the EDMdatabase. The actual attribute is specified by the attribute name. The attribute name must be qualified by the related entity name if the attribute name is not unique for the actual instance.
The specified primitive type <valueType> must be the same as the actual data type of the attribute value or a compatible data type. The primitive type sdaiSELECT can be used to get all data types. The primitive type sdaiADB can be used to get all data types except typed value. The primitive type sdaiINTEGER is compatible with sdaiREAL, and sdaiBOOLEAN is compatible with sdaiLOGICAL, hence conversion between these compatible data types will be performed when required.
The model that holds the actual instance must be open before this function can be successfully performed.
Related functions: sdaiGetAttr , sdaiGetAttrs , sdaiGetAttrsBN
Header:
#include "sdai.h"
Prototype:
void *sdaiGetAttrBN(SdaiInstance        instance,
                     SdaiString          attributeName, 
                     SdaiPrimitiveType   valueType, 
                     void                *value); 
Arguments:

instance

A numeric instanceID that uniquely identifies an instance in the EDMdatabase.
The instanceID is defined by a sdaiCreateInstance or a sdaiCreateInstanceBN function.

attributeName

Name of the attribute that holds the value to be read. Attribute names are case insensitive. The attribute must be qualified with the entity name when the attribute name is not unique within the entity.

valueType

The data type, i.e. the primitive type of the data value to be retrieved. This <valueType> must be the same or a compatible type of the primitive type of the actual attribute value. The primitive type sdaiSELECT can be used to read all data types. The primitive type sdaiADB can be used to read all data types except typed values.
The primitive type sdaiINTEGER is compatible with sdaiREAL, and sdaiBOOLEAN is compatible with sdaiLOGICAL, hence conversion between these compatible data types will be performed when required.

value

The variable that will hold a copy of the data value read from the actual attribute. The type of <value> must be the same or a compatible type of <valueType>.

Returns:
void * = address of <value> : operation successfully performed.
void * = NULL: error during operation – use sdaiErrorQuery function to get error reason.
Example:
SdaiInstance aPoint;
SdaiReal xValue;
...
p = sdaiGetAttrBN (aPoint, "X" , sdaiREAL, &xValue);
if (p == NULL) {
/* Error in operation */ 
printf("\nError: %s in sdaiGetAttrBN \n", 
edmiGetErrorText(sdaiErrorQuery())); 
goto error; 
}
. . .