sdaiGetEntity


Returns a numeric entityID that uniquely identifies an entity definition instance in the EDMdatabase. The actual entity is defined by a numeric modelID that uniquely identifies a model in the EDMdatabase that has the EXPRESS schema that defines the actual entity as the underlying schema.
The actual model must be open before this function can be successfully performed.
If the specified <entityName> is the name of a legal complex entity that does not exist as an entity definition instance in the related dictionary model, an entity definition instance of the actual complex entity, will be created in the related dictionary model.
The returned entityID can be used to identify the actual entity in subsequent EDMinterface operations. The returned entityID will be a constant value throughout the lifetime of the actual entity definition instance in the EDMdatabase.
Related functions: edmiGetSchema , sdaiGetAttrDefinition , sdaiGetAttrDefinitionBN
Header:
#include "sdai.h"
Prototype:
SdaiEntity sdaiGetEntity(SdaiModel  model,
                          SdaiString entityName); 
Arguments:

model

A numeric modelID that uniquely identifies a model in the EDMdatabase that has the EXPRESS schema that defines the actual entity as the underlying schema. This model must be open.
The modelID is returned from the functions: sdaiCreateModel , sdaiCreateModelBN , sdaiOpenModelBN , edmiGetModel , edmiGetModelBN , sdaiGetInstanceModel

entityName

The name of the actual entity. Entity names are case insensitive. An entity name is unique within one model, i.e. within one EXPRESS schema.

Returns:
A numeric entityID that uniquely identifies the actual entity definition instance in the EDMdatabase.
entityID != 0 : operation successfully performed.
entityID = 0 : operation failed, use sdaiErrorQuery function to get error reason.
Example:
SdaiEntity pointId;
SdaiModel model;
...
pointId = sdaiGetEntity(model, "Cartesian_Point");
if (! pointId) {
/* Error in operation */ 
printf("\nError: %s in sdaiGetEntity \n", 
edmiGetErrorText(sdaiErrorQuery())); 
goto error; 
}
. . .