sdaiCreateModelBN


Creates a new model in the specified repository in the EDMdatabase. A model is a logical container for entity instances defined by one EXPRESS schema. This schema will be the underlying schema of the new model and this particular schema must exist as a dictionary model in the EDMdatabase before this function can be successfully performed. Only data models can be created by this function. Any number of models of the same EXPRESS schema can exist in an EDMdatabase.
The new model will be closed after creation, hence one of the functions sdaiOpenModel or sdaiOpenModelBN must be performed on the model before any access to it is permitted.
A numeric modelID that uniquely identifies the created model in the EDMdatabase is returned. This modelID should be used in subsequent EDMinterface operations to identify this particular model. The model name qualified with the related repository name will also uniquely identify a model in an EDMdatabase.
The executing EDMuser will be the owner of the new model and the current EDMgroup account of the executing EDMuser will be the owner group of the model. The owner and owner group of a model is relevant for access rights to the model in subsequent sdaiOpenModel and sdaiOpenModelBN operations. The model protection will be set according to the default model protection of the executing EDMuser.
The repository that will hold the new model must be open before this function can be successfully performed.
Related functions: sdaiCreateModel, edmiCreateModel ,edmiCreateModelBN , sdaiOpenModel , sdaiOpenModelBN , sdaiDeleteModel , edmiDeleteModel , edmiDeleteModelBN , edmiDeleteOpenModel
Header:
#include "sdai.h"
Prototype:
SdaiModel sdaiCreateModelBN(SdaiRepository   repository,
                                                   SdaiString          modelName, 
                                                   SdaiString          schemaName); 
Arguments:

repository

A numeric repositoryID that uniquely identifies the repository in the EDMdatabase that will hold the new model. This repository must be open.
The repositoryID is returned by the sdaiOpenRepository and sdaiOpenRepositoryBN functions.

modelName

Specify the name of the new model. A model name must start with a letter and the rest of the model name can optionally be any mix of any alphanumeric character and the underscore character. Model names are case sensitive. A model name must be unique within the repository that holds the model.

schemaName

The name of an EXPRESS schema in the EDMdatabase that will be the underlying schema of the new model. Schema names are case insensitive. This schema defines all possible instance types that can be created in the actual model. This particular EXSPRESS schema must exist as a dictionary model in the EDMdatabase before this operation can be successfully performed.

 
Returns:
A numeric modelID that uniquely identifies the new created model in the actual EDMdatabase. This modelID should be used to identify the particular model in subsequent EDMinterface operations.
modelID != 0 : operation successfully performed.
modelID = 0 : operation failed, use sdaiErrorQuery function to get error reason.
Example:
SdaiRepository repository;
SdaiSchema schema;
SdaiModel modelId;
...
modelId = sdaiCreateModelBN (repository, "Building_AXD67H", "IFC151");
if (! modelId) {
/* Error in operation */ 
printf("\nError: %s in sdaiCreateModelBN \n", 
edmiGetErrorText(sdaiErrorQuery())); 
goto error; 
}
. . .