sdaiGetInstanceType
Return the instance type of the specified instance. The instance type is returned as an entityID that uniquely identifies the entity definition instance in the EDMdatabase that defines the actual entity, i.e. the actual instance type.
The model that holds the actual instance must be open before this function can be successfully performed.
Related functions: sdaiIsInstanceOf , sdaiIsInstanceOfBN , sdaiIsKindOf , sdaiIsKindOfBN
Header:
#include "sdai.h"
Prototype:
SdaiEntity sdaiGetInstanceType(SdaiInstance instance);
Arguments:
instance |
A numeric instanceID that uniquely identifies the instance of interest in the EDMdatbase. The instanceID is defined by a sdaiCreateInstance or a sdaiCreateInstanceBN function. |
Returns:
A numeric entityID that uniquely identifies the entity definition instance in the EDMdatabase that defines the instance type of the actual instance.
entityID != 0 : operation successfully performed.
entityID = 0 : operation failed, use sdaiErrorQuery function to get error reason.
Example:
SdaiEntity entityId;
SdaiString name;
SdaiAppInstance instance;
...
entityId = sdaiGetInstanceType(instance);
if (! entityId) {
/* Error in operation */
printf("\nError: %s in sdaiGetInstanceType \n",
edmiGetErrorText(sdaiErrorQuery()));
goto error;
}
sdaiGetAttrBN(entityId, "Name", sdaiSTRING, &name);
if (name != NULL) {
printf("\nInstance type: %s",name);
edmiFree(name);
}
. . .