4.1 Introduction
This chapter provides an alphabetical reference to the functions provided by the SDAI C programming library.
Organization
Each function's description begins with the function's prototype. After the prototype, there is a description of the function's purpose and its parameters. This section also describes any side effects that the function may have, and what value, if any, is returned by the function.
Errors
The errors section lists the errors, and gives a brief explanation of what conditions can cause each error to be flagged.
Example
For some of the functions, this manual provides an example of how the code may be used. Unless otherwise indicated, this example is neither a complete program nor function, but rather an outline which briefly demonstrates how the function may be used.
See Also
The See Also section provides cross reference to related functions in the SDAI binding, provides a reference to the clauses in the SDAI standard (both Part 22 and Part 24) which define the function.
Conformance Class
The SDAI implementation described in this document supports the following conformance classes:
- Level 2 of transaction support
- Level 2 of expression evaluation support
- Level 1 of event recording support
- Level 1 of scope support
- Level 1 of domain equivalence support.
This means that the this implementation provides the support required by implementation class 1 and class 2 except for scope support. It conforms to Implementation Class 4, with the exception of session recording support.
The following table is derived from Table 7 from ISO 10303-22. It shows what functionality is required by which implementation class (Y means the functionally is required, N means it is not; D or E means that a subset of the functionality is required). The table cells that are highlighted are identify the functionality that is present or exceeded in this implementation.
|
Operation |
Implementation Class |
||||||
|---|---|---|---|---|---|---|---|
|
1 |
2 |
3 |
4 |
5 |
6 |
7 |
|
|
Open Session |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
|
Record error |
N* |
N* |
N* |
Y |
Y |
Y |
Y |
|
Start event recording |
N* |
N* |
N* |
Y |
Y |
Y |
Y |
|
Stop event recording |
N* |
N* |
N* |
Y |
Y |
Y |
Y |
|
Close session |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
|
Open repository |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
|
Start transaction read-write access |
N* |
N* |
N* |
N* |
Y |
Y |
Y |
|
Start transaction read-only access |
N* |
N* |
N* |
N* |
Y |
Y |
Y |
|
Commit |
N* |
N* |
N* |
N* |
Y |
Y |
Y |
|
Abort |
N* |
N* |
N* |
N* |
Y |
Y |
Y |
|
End transaction access and commit |
N* |
N* |
N* |
N* |
Y |
Y |
Y |
|
End transaction access and abort |
N* |
N* |
N* |
N* |
Y |
Y |
Y |
|
Create non-persistent list |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
|
Delete non-persistent list |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
|
SDAI query |
N* |
N* |
Y |
N* |
N* |
Y |
Y |
|
Create SDAI -model |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
|
Create schema instance |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
|
Close repository |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
|
Delete schema instance |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
|
Rename schema instance |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
|
Add SDAI-model |
D* |
D* |
Y* |
D* |
D* |
Y* |
Y* |
|
Remove SDAI-model |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
|
Validate global rule |
N* |
N* |
E* |
N* |
N* |
E* |
Y* |
|
Validate uniqueness rule |
N* |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
|
Validate instance reference domain |
N* |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
|
Validate schema instance |
N* |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
|
Is validation current |
N* |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
|
SDAI -model operations (not Save Undo, get dictionary) |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
|
Get entity definition |
N* |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
|
Save and Undo |
N* |
N* |
N* |
Y* |
N* |
N* |
N* |
|
Scope operations |
N* |
Y |
Y |
N* |
N* |
N* |
Y |
|
Get complex entity definition |
N* |
N* |
N* |
N* |
N* |
N* |
Y* |
|
Is subtype of |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
|
Is SDAI subtype of |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
|
Is domain equivalent with |
N* |
N* |
Y |
N* |
Y |
Y |
Y |
|
Get population dependent bound |
N* |
E |
E |
E |
E |
E |
Y |
|
Get attribute |
E* |
E* |
E* |
E* |
E* |
E* |
Y |
|
Get instance type |
N* |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
|
Entity instance operations |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
|
Find entity instance users |
N* |
N* |
Y* |
N* |
N* |
Y* |
Y* |
|
Find entity instance usedin |
N* |
N* |
Y* |
N* |
N* |
Y* |
Y* |
|
Get attribute value bound |
E |
E |
E |
E |
E |
E |
Y |
|
Find roles played |
N* |
N* |
N* |
N* |
N* |
N* |
Y* |
|
Find data types |
N* |
N* |
N* |
N* |
N* |
N* |
Y* |
|
Copy application instance |
D* |
D* |
Y |
D* |
D* |
Y |
Y |
|
Application instance operations except validation and label |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
|
Application instance operations: persistent label operations |
N* |
N* |
N* |
Y* |
Y* |
Y* |
Y* |
|
Get description |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
|
Application instance operations: simple validation |
N* |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
|
Application instance operations: validation |
N* |
E* |
E* |
E* |
E* |
E* |
Y* |
|
Entity and application instance bound related aggregate operations |
N* |
E* |
E* |
E* |
E* |
E* |
Y* |
|
All entity and application instance non-bound related aggregate operations |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
Y* |
Unimplemented Functions
There are a number of functions defined in Part 22, but not documented here. These functions are not included in the conformance class that this SDAI implementation provides, and will generate the error FN_NAVL (function is not available) if they are called. These unimplemented functions consist of the following:
sdaiAddToExportList();
sdaiAddToScope();
sdaiBreakTrx();
sdaiEndTrx();
sdaiGetAggrElementBoundByIndex()
sdaiGetAggrElementBoundByItr();
sdaiGetAttrBound();
sdaiGetAttrBoundBN();
sdaiGetExportList();
sdaiGetLowerBound();
sdaiGetOwnedScopeInstances();
sdaiGetScope();
sdaiGetScopeOwner();
sdaiGetUpperBound()
sdaiIsDeqWith();
sdaiIsDeqWithBN();
sdaiIsRecordingOn();
sdaiIsScopeOwner();
sdaiIsValidationCurrent();
sdaiQuery();
sdaiRecordEvent();
sdaiReindexArray();
sdaiRemoveFromExportList();
sdaiRemoveFromScope();
sdaiScopedCopyInSameModel();
sdaiScopedCopyToOtherModel();
sdaiScopedDelete();
sdaiSetEventRecording();
sdaiStartTrx();
sdaiValidateScopeReferenceRestrictions();
4.2 sdaiAccessModel()
SdaiModel sdaiAccessModel( SdaiModel model, SdaiAccessMode mode );
The sdaiAccessModel() function makes the instances in an SDAI model available for access as either real-only or read-write. Until this function is called, any attempt to access the contents of a model results in an error. The parameter mode must be specified as sdaiRW (for read-write) or sdaiRO (for read only).
This function causes model.contents , model.underlying_schema andmodel.mode to be set. This function returns the parameter model unless there was an error in which case it returns sdaiNULL .
Errors
sdaiSS_NOPN session is not open
sdaiMO_NEXS NULL or invalid model
sdaiRP_NOPN repository not open
sdaiMX_RO model is already open in read-only mode
sdaiMX_RW model is already open in read-write mode
Example
SdaiModel mod;
sdaiAccessModel (mod, sdaiRW);
See Also
sdaiAccessModelBN();sdaiEndModelAccess(); ISO 10303- 22- 10.7.3, 10.7.6; ISO 10303- 24- 6.5.3
4.3 sdaiAccessModelBN()
SdaiModel sdaiAccessModelIBN( SdaiRep repository, SdaiString modelName, SdaiAccessMode mode );
The sdaiAccessModelBN() function makes the instances in an SDAI model available for access as either real-only or read-write. Until this function is called, any attempt to access the contents of a model will result in an error.
repository- the repository containing the model to be accessed. This repository must be opened for access.
modelName- The name of the model to be opened. This can be obtained by examining repository.contents.models.
mode- sdaiRW (for read-write) or sdaiRO (for read only) access
This function causes model.contents , model.underlying_schema and model.mode to be set. This function returns the model accessed unless there was an error in which case it returns sdaiNULL .
Errors
sdaiSS_NOPN session is not open
sdaiMO_NEXS NULL or invalid model
sdaiRP_NOPN repository not open
sdaiRP_NEXS NULL repository {this error is not in p22/24}
sdaiMX_RO model is already open in read-only mode
sdaiMX_RW model is already open in read-write mode
Example
SdaiModel mod;
SdaiSession sess = sdaiOpenSession();
SdaiRep rep = sdaiOpenRepositoryBN (sess, "standard_3.0");
mod = sdaiAccessModelBN (rep, "data", sdaiRW);
See Also
sdaiAccessModel(); sdaiEndModelAccess(); ISO 10303-22- 10.7.4, 10.7.6; ISO 10303-24- 6.5.3
4.4 sdaiAdd()
void sdaiAdd( SdaiUnorderedAggr unorderedAggr, SdaiPrimitiveType valueType, <TYPE> value );
The sdaiAdd() function adds a value to an unordered aggregate. The valueType parameter identifies the type of the value parameter and should be sdaiINTEGER , sdaiREAL , sdaiBOOLEAN , sdaiLOGICAL , sdaiSTRING , sdaiBINARY , sdaiENUM , sdaiINSTANCE , sdaiAGGR or sdaiADB .
Errors
sdaiAI_NEXS aggregate does not exist
sdaiAI_NVLD aggregate is internal or is not unordered
sdaiMX_NRW model is not writable
sdaiSS_NOPN session is not open
sdaiVT_NVLD value type cannot be converted to type of aggregate
See Also
ISO 10303-22-10.14.1; ISO 10303-24-6.12.1
4.5 sdaiAddModel
void sdaiAddModel( SdaiSchemaInstance schemaInstance, SdaiModel model );
The sdaiAddModel() function adds a new model to a schema instance.
Errors
sdaiSS_NOPN session not open
sdaiSI_NEXS schema instance does not exist
sdaiMO_NEXS model does not exist, or NULL value passed in
sdaiRP_NOPN model's repo is not open
sdaiMX_NDEF model not open
See also
ISO 10303 - 22- 10.6.3; ISO 10303 - 24- 6.4.3
4.6 sdaiAddModelBN
void sdaiAddModelBN ( SdaiSchemaInstance schemaInstance, SdaiRep repository, SdaiString modelName );
The sdaiAddModelBN() function adds a model to an existing schema instance. The model is identified by name in a repository.
Errors
sdaiSS_NOPN session not open
sdaiSI_NEXS schema instance does not exist
sdaiMO_NEXT model does not exist, or NULL value passed in
sdaiRP_NOPN model's repo is not open
sdaiMX_NDEF model not open
Example
sdaiAddModelBN (si, rep, "aModel");
See Also
ISO10303-22-10.6.3; ISO10303-24-6.4.3
4.7 sdaiBeginning()
void sdaiBeginning( SdaiIterator iterator );
The sdaiBeginning() function moves an iterator to the beginning of the aggregate. The current value of the iterator is then unset. The next sdaiNext() call will set the iterator to the aggregate's first element.
Errors
sdaiSS_NOPN session not open
sdaiIR_NEXS iterator NULL
sdaiAI_NEXS aggregate does not exist or is empty
See Also
sdaiNext(); ISO 10303-22-10.12.5; ISO 10303-24-6.10.5
4.8 sdaiCloseRepository()
void sdaiCloseRepository( SdaiRep repository, );
The sdaiCloseRepository() function closes a repository and all of the models contained in it. Any further attempts to access the repository will generate errors, and any attempt to access any instance, in any model in the closed repository is undefined.
Errors
sdaiRP_NEXS sdaiNULL repository
sdaiRP_NOPN repository not open
See Also
ISO 10303-22- 10.5.3; ISO 10303-24- 6.3.3
4.9 sdaiCloseSession()
void sdaiCloseSession( SdaiSession session );
The sdaiCloseSession() function ends the SDAI session. No further SDAI operations may be performed after a session is closed.
This function takes a parameter session , which identifies the session to be closed. This parameter should be the return value from the most recent call to sdaiOpenSession() .
Errors
sdaiSS_NOPN : the session was not open.
Example
SdaiSession sess;
.
.
.
sess = sdaiOpenSession();
.
. /* SDAI Operations here */
.
sdaiCloseSession(sess);
See Also
ISO 10303-22- 10.4.5; ISO 10303-24- 6.2.4
4.10 sdaiCreateADB()
SdaiADB sdaiCreateADB( SdaiPrimitiveType valueType, <TYPE> value );
The sdaiCreateADB() function creates an Attribute Data Block (ADB). An ADB is a typed union which can contain any SDAI data type. The Part 22 specification does not permit an ADB to be passed to this function, however, this implementation will permit it, copying the type and value of the ADB into the newly created ADB.
The parameter valueType identifies the type of parameter value , and should be one of the following: sdaiINTEGER , sdaiREAL , sdaiBOOLEAN , sdaiLOGICAL , sdaiSTRING , sdaiBINARY , sdaiENUM , sdaiINSTANCE , sdaiAGGR , or sdaiADB . The value parameter identifies the data to be stored in the new ADB.
This function returns the handle of the newly created ADB. This ADB should be freed by calling sdaiDeleteADB() after you are finished using it.
Errors
sdaiSS_NOPN session is not open
sdaiVT_NVLD valueType is not a legal type for this function.
Example
SdaiADB adb1, adb2, adb3;
SdaiInstance inst;
adb1 = sdaiCreateADB (sdaiINTEGER, 12);
adb2 = sdaiCreateADB (sdaiSTRING, "String in an ADB");
adb3 = sdaiCreateADB (sdaiINSTANCE, inst);
See Also
sdaiCreateEmptyADB(); sdaiDeleteADB(); ISO 10303-24- 6.2.12.1
4.11 sdaiCreateAggr()
SdaiAggr sdaiCreateAggr( SdaiAppInstance instance, SdaiExplicitAttr attribute );
The sdaiCreateAggr function() creates a new, empty aggregate as the value of an attribute in an instance. This function is used to set attributes that have aggregate slot types.
This function returns the newly created aggregate.
Errors
sdaiSS_NOPN session not open
sdaiEI_NEXS NULL entity/entity not an application instance
sdaiMX_NRW model not writable
sdaiAT_NDEF NULL attribute
sdaiED_NVLD entity object is not an entity
sdaiVA_NSET attribute is unset
sdaiAT_NVLD attribute is not an aggregate
See Also
ISO 10303-22-10.11.5; ISO 10303-24-6.9.6
4.12 sdaiCreateAggrADB()
SdaiAggr sdaiCreateAggrADB ( SdaiAppInstance instance, SdaiExplicitAttr attr, SdaiADB block );
The sdaiCreateAggrADB() function creates a new, empty aggregate as the value of an attribute. This function is used to set the values of attribute that have aggregate types. The block parameter is used to identify the type of the attribute in the event that it is a SELECT.
Errors
sdaiSS_NOPN session not open
sdaiEI_NEXS NULL entity/entity not an application instance
sdaiMX_NRW model not writable
sdaiAT_NDEF NULL attribute
sdaiED_NVLD entity object is not an entity
sdaiVA_NSET attribute is unset
sdaiAT_NVLD attribute is not an aggregate
See Also
ISO 10303-24-6.9.6; ISO 10303-22-10.11.5
4.13 sdaiCreateAggrBN()
SdaiAggr sdaiCreateAggrBN( SdaiAppInstance instance, SdaiString attributeName );
The sdaiCreateAggr() function creates a new, empty aggregate as the value of an attribute in an instance. The parameter attributeName identifies the attribute where the aggregate is created.
This function returns the newly created aggregate.
Errors
sdaiSS_NOPN session not open
sdaiEI_NEXS NULL entity/entity not an application instance
sdaiMX_NRW model not writable
sdaiAT_NDEF NULL attribute
sdaiED_NVLD entity object is not an entity
sdaiVA_NSET attribute is unset
sdaiAT_NVLD attribute is not an aggregate
sdaiED_NDEF entity definition NULL or not defined
See Also
ISO 10303-22-10.11.5; ISO 10303-24-6.9.6
4.14 sdaiCreateAggrADBBN()
SdaiAggr sdaiCreateAggrADBBN ( SdaiAppInstance instance, SdaiString attributeName, SdaiADB adb );
The sdaiCreateAggrBNADB() function creates a new, empty aggregate as the value of an attribute. This function is used to set the values of attribute that have aggregate types. The block parameter is used to identify the type of the attribute in the event that it is a SELECT.
Note
In past releases, this function was named sdaiCreateAggrBNADB() . This function was omitted from earlier drafts of Part 24, and when it was added the name was changed to be is sdaiCreateAggrADBBN() .
Errors
sdaiSS_NOPN session not open
sdaiEI_NEXS NULL entity/entity not an application instance
sdaiMX_NRW model not writable
sdaiAT_NDEF NULL attribute
sdaiED_NVLD entity object is not an entity
sdaiVA_NSET attribute is unset
sdaiAT_NVLD attribute is not an aggregate
See Also
ISO 10303-24-6.9.6; ISO 10303-22-10.11.5
4.15 sdaiCreateComplexInstance()
SdaiAppInstance sdaiCreateComplexInstance( SdaiModel model, SdaiNPL entityList );
The sdaiCreateComplexInstance() function creates an instance of a complex (AND-OR) entity. The entity must be in the working set for the compiled EXPRESS schema. The entityList parameter is an NPL, filled with entity_definition instances, which define the supertypes of the requested complex type.
This is a convenience function which basically calls sdaiGetComplexEntity() followed by sdaiCreateInstance() . If you need to create several complex instances of the same type, it is more efficient to call sdaiGetComplexEntity() once, then use sdaiCreateInstance() to create the individual instances.
This function returns the handle of the newly created instance. If there was an error, sdaiNULL is returned.
Errors
sdaiSS_NOPN session not open
sdaiED_NDEF NPL is not valid or NULL or list is empty, entity not in schema
sdaiED_NVLD an entity in the list is not valid
sdaiMO_NEXS model does not exist, or NULL value passed in
sdaiRP_NOPN model's repo is not open
sdaiMX_NRW model not read-write
See Also
sdaiCreateInstance(); sdaiGetComplexEntity(); sdaiCreateComplexInstanceBN(); ISO 10303-24- 6.5.10.1
4.16 sdaiCreateComplexInstanceBN()
SdaiAppInstance sdaiCreateComplexInstanceBN( SdaiModel model, SdaiInteger nameNumber SdaiString * nameVector );
The sdaiCreateComplexInstanceBN() function creates an instance of a complex (AND-OR) entity by name. The complex entity must be in the working set for the compiled EXPRESS schema. The parameter nameVector is an array of strings (size is the parameter nameNumber ) containing entity names for the supertypes of the complex entity.
This is a convenience function which calls sdaiGetComplexEntityBN() followed by sdaiCreateInstance() . If you need to create several complex instances of the same type, it is more efficient to call sdaiGetComplexEntityBN() once, then use sdaiCreateInstance() to create the individual instances.
This function returns the handle of the newly created instance. If there was an error, sdaiNULL is returned.
Errors
sdaiSS_NOPN session is not open
sdaiMO_NEXS NULL or invalid model
sdaiED_NDEF entity not in EXPRESS
sdaiRP_NOPN model's repo is not open
sdaiED_NVLD entity is not in model's schema
sdaiMX_NRW model not read-write
See Also
sdaiCreateInstance(); sdaiGetComplexEntity(); ISO 10303-24- 6.5.10.1
4.17 sdaiCreateEmptyADB()
SdaiADB sdaiCreateEmptyADB();
The sdaiCreateEmptyADB() creates an empty Attribute Data Block (ADB). The type and value of the newly created ADB are unset, and any attempt to retrieve the value from the ADB will generate an error until it is populated.
Errors
sdaiSS_NOPN session is not open
Example
SdaiADB adb;
adb = sdaiCreateADB();
See Also
sdaiCreateADB(); sdaiDeleteADB(); ISO 10303-24- 6.2.12.1
4.18 sdaiCreateInstance()
SdaiAppInstance sdaiCreateInstance( SdaiModel model, SdaiEntity entity );
The sdaiCreateInstance() function creates a new instance of the specified entity in a specified model. The entity must be defined in the model's schema or an error is generated.
This function returns a handle to the newly created instance. On error, sdaiNULL is returned.
Errors
sdaiSS_NOPN session not open
sdaiMO_NEXS model does not exist, or NULL value passed in
sdaiRP_NOPN model's repo is not open
sdaiED_NDEF entity definition NULL or not defined
sdaiED_NVLD entity is not in model's schema
Example
SdaiSession sess;
SdaiRep repo;
SdaiModel mod;
SdaiEntity ent;
SdaiAppInstance inst;
:
sess = sdaiOpenSession();
repo = sdaiOpenRepository (sess, "standard_3.0");
mod = sdaiAccessModelBN (repo, "modname", sdaiRW);
:
ent = sdaiGetEntity (mod, "cartesian_point");
inst = sdaiCreateInstance (mod, ent);
See Also
sdaiCreateInstanceBN(); ISO 10303-22- 10.7.9; ISO 10303-24- 6.5.7
4.19 sdaiCreateInstanceBN()
SdaiAppInstance sdaiCreateInstanceBN( SdaiModel model, SdaiString entityName );
The sdaiCreateInstanceBN() function creates a new instance in a specified model, of the type whose name is specified by the parameter entityName .
This function returns a handle to the newly created instance. On error, sdaiNULL is returned.
Errors
sdaiSS_NOPN session not open
sdaiMO_NEXS NULL or invalid model
sdaiMX_NDEF model not accessible
sdaiED_NDEF cannot find entity or NULL name
sdaiRP_NOPN model's repo is not open
Example
SdaiSession sess;
SdaiRep repo;
SdaiModel mod;
SdaiEntity ent;
SdaiAppInstance inst; :
sess = sdaiOpenSession();
repo = sdaiOpenRepository (sess, "standard_3.0");
mod = sdaiAccessModelBN (repo, "modname", sdaiRW);
:
:
inst = sdaiCreateInstanceBN (mod, "cartesian_point");
See Also
sdaiCreateInstance(); ISO 10303-22- 10.7.9; ISO 10303-24- 6.5.7
4.20 sdaiCreateIterator()
SdaiIterator sdaiCreateIterator( SdaiAggr aggregate );
The sdaiCreateIterator() function creates an iterator over an aggregate specified by parameter aggregate . An iterator is an object that permits access to the elements in an aggregate one element at a time. This is the preferred way to access the elements of an aggregate.
If successful, this function returns the handle of the newly created iterator, otherwise, it returns sdaiNULL .
Errors
sdaiSS_NOPN session not open
sdaiAI_NEXS NULL aggregate
See Also
ISO 10303-22-10.12.3; ISO 10303-24-6.10.3
4.21 sdaiCreateModel()
sdaiModel sdaiCreateModel( SdaiRep repository, SdaiString modelName, SdaiSchema schema );
The sdaiCreateModel() function creates a new SDAI model. The model is associated with a single repository ( repository ) and a single schema ( schema ). The repository must be open, and requested modelName must be unique within the repository. It returns a handle for the new model. The new model will be saved as a STEP Part 21 file, by default.
In this implementation, the sdaiCreateModel() function does not effect any persistent changes (e.g. no files are created) in the repository until the model is saved.
Errors
sdaiSS_NOPN session not open
sdaiRP_NEXS repository is sdaiNULL or not repository
sdaiRP_NOPN rep not open
sdaiMO_DUP model with name already exists
sdaiSD_NDEF schema is NULL or in invalid
Example
SdaiSession sess;
SdaiRep repo;
SdaiSchema sch;
SdaiModel mod;
sess = sdaiOpenSession ();
repo = sdaiOpenRepositoryBN (sess, "standard_3.0");
sch = sdaiGetSchema ("configuration_controlled_design");
mod = sdaiCreateModel (repo, "newmod", sch);
See Also
sdaiOpenRepository(); sdaiOpenRepositoryBN(); sdaiCreateModelBN(); ISO 10303-22- 10.5.1; ISO 10303-24- 6.3.1
4.22 sdaiCreateModelBN()
SdaiModel sdaiCreateModelBN( SdaiRep repository, SdaiString modelName, SdaiString schemaName );
The sdaiCreateModel() function creates a new SDAI model. The model is associated with a single repository (parameter repository ) and a single schema. The schema is specified by in the schemaName parameter. The new model will be saved as a STEP Part 21 file, by default.The repository must be open, and requested model name must be unique within the repository.
In this implementation, this function does not effect any persistent changes (e.g. no files are created) in the repository until the model is saved.
Errors
sdaiSS_NOPN session not open
sdaiRP_NEXS repository is sdaiNULL or not repository
sdaiRP_NOPN rep not open
sdaiMO_DUP model with name already exists
sdaiSD_NDEF cannot find requested schema
Example
SdaiSession sess;
SdaiRep repo;
SdaiSchema sch;
SdaiModel mod;
sess = sdaiOpenSession ();
repo = sdaiOpenRepositoryBN (sess, "standard_3.0");
mod = sdaiCreateModel (repo, "newmod",
"configuration_controlled_design");
See Also
sdaiOpenRepository(); sdaiOpenRepositoryBN(); sdaiCreateModel(); ISO 10303-22- 10.5.1; ISO 10303-24- 6.3.1
4.23 sdaiCreateNestedAggr()
SdaiAggr sdaiCreateNestedAggr( SdaiUnorderedAggr aggregate );
The sdaiCreateNestedAggr() function creates a new aggregate and adds it to the unordered aggregate of aggregates specified by parameter aggregate .
Errors
sdaiSS_NOPN session is not open
sdaiAI_NEXS aggregate does not exist
sdaiAI_NVLD aggregate is internal and thus not writable
sdaiMX_NRW model is not writable
See Also
ISO 10303-22-10.14.2; ISO 10303-24-6.12.2
4.24 sdaiCreateNestedAggrADB()
SdaiAggr sdaiCreateNestedAggrADB( SdaiUnorderedAggr aggregate, SdaiADB selaggrInstance );
The sdaiCreateNestedAggr() function creates a new aggregate and adds it to the unordered aggregate specified as parameter aggregate . An ADB is provided to specify the type of the aggregate in case the function is dealing with an aggregate of SELECTs.
This function returns the newly created aggregate, and the ADB contains the newly created aggregate.
Errors
sdaiSS_NOPN session is not open
sdaiAI_NEXS aggregate does not exist
sdaiAI_NVLD aggregate is internal and thus not writable
sdaiMX_NRW model is not writable
sdaiAB_NEXS NULL ADB
See Also
ISO 10303-22-10.14.2; ISO 10303-24-6.12.2
4.25 sdaiCreateNestedAggrByIndex()
SdaiAggr sdaiCreateNestedAggrByIndex( SdaiOrderedAggr aggregate, SdaiAggrIndex index );
The sdaiCreateNestedAggrByIndex() function creates a nested aggregate at a specific index of the aggregate instance specified by parameter aggregate .
This function returns the newly create aggregate instance.
Errors
sdaiSS_NOPN session is not open
sdaiAI_NEXS aggregate does not exist
sdaiAI_NVLD aggregate is invalid
sdaiMX_NRW model is not writable
sdaiIX_NVLD index is invalid
See Also
ISO 10303-22-10.16.2; ISO 10303-24-6.14.2
4.26 sdaiCreateNestedAggrByIndexADB()
SdaiAggr sdaiCreateNestedAggrByIndexADB( SdaiOrderedAggr aggregate, SdaiAggrIndex index, SdaiADB selaggrInstance );
The sdaiCreateNestedAggrByIndexADB() function creates a nested aggregate at a specific index of a specified aggregate instance. An ADB is used to specify the type of the aggregate when the members of the aggregate are SELECT typed objects.
This function returns the newly created aggregate instance. The ADB's value is set to the new aggregate.
Errors
sdaiSS_NOPN session is not open
sdaiAI_NEXS aggregate does not exist
sdaiAI_NVLD aggregate is invalid
sdaiMX_NRW model is not writable
sdaiIX_NVLD index is invalid
See Also
ISO 10303-22-10.16.2; ISO 10303-24-6.14.2
4.27 sdaiCreateNestedAggrByItr()
SdaiAggr sdaiCreateNestedAggrByItr( SdaiIterator current );
The sdaiCreateNestedAggrByItr() function creates a new nested aggregate in an aggregate instance. The new aggregate replaces the current value at the iterator current .
This function returns the newly created aggregate.
Errors
sdaiSS_NOPN session not open
sdaiIR_NEXS iterator NULL
sdaiMX_NRW write permission denied, or iterator is not writable
sdaiIR_NSET Iterator not at a valid index
sdaiVA_NSET Aggregate cannot be populated with an aggregate
See Also
ISO 10303-22-10.13.1; ISO 10303-24-6.11.1
4.28 sdaiCreateNestedAggrByItrADB()
SdaiAggr sdaiCreateNestedAggrByItrADB( SdaiIterator current, SdaiADB selaggrInstance );
The sdaiCreateNestedAggrByItrADB() function creates a new nested aggregate in an aggregate instance. This function should be used instead of sdaiCreatedNestedAggrByItr() when the aggregate consists of SELECT type attributes to disambiguate the type of the new aggregate.
This function returns the newly created aggregate. The new aggregate is also placed into the ADB specified by the parameter selaggrInstance .
Errors
sdaiSS_NOPN session not open
sdaiIR_NEXS iterator NULL
sdaiMX_NRW write permission denied, or aggregate is not writable. sdaiIR_NSET Iterator not at a valid index
sdaiVA_NSET Aggregate cannot be populated with an aggregate
sdaiAB_NEXS NULL ADB
See Also
ISO 10303-22-10.13.1; ISO 10303-24-6.11.1
4.29 sdaiCreateNPL()
SdaiNPL sdaiCreateNPL();
The sdaiCreateNPL() function creates a non-persistent list. A non-persistent list is an SDAI aggregate which contains entity instances. The list may not be assigned to an attribute (e.g. with sdaiPutAttrBN ) and will be automatically deleted when the session is closed. A non-persistent list (NPL) handle may be used in any SDAI function that takes a list as an argument.
This function returns a handle for a newly created non-persistent list. When you are finished using it, you should call sdaiDeleteNPL() to release the memory consumed by the NPL.
Errors
sdaiSS_NOPN session is not open
Example
SdaiNPL list;
:
:
list = sdaiCreateNPL ();
:
:
sdaiDeleteNPL (list);
See Also
sdaiDeleteNPL ;ISO 10303-22- 10.4.12;ISO 10303-24- 6.2.8
4.30 sdaiCreateSchemaInstance()
sdaiSchemaInstance sdaiCreateSchemaInstance( SdaiString schemaInstanceName, SdaiSchema schema, SdaiRep repository );
The sdaiCreateSchemaInstance() function create a new schema instance. A schema instance is a collection of models which may have reference between them. Support for schema instances is very limited in this implementation currently. They are non-persistent, and only a single model may be added to a schema instance. This will be changed when ROSE has full domain interoperability support.
Errors
sdaiSS_NOPN session is not open
sdaiSD_NDEF schema not defined
See Also
ISO 10303-22- 10.5.1; ISO 10303-24- 6.3.2
4.31 sdaiCreateSchemaInstanceBN()
SdaiSchemaInstance sdaiCreateSchemaInstanceBN( SdaiString schemaInstanceName, SdaiString schemaName, SdaiRep repository );
The sdaiCreateSchemaInstanceBN() function creates a schema new schema instance. A schema instance is a collection of models (not necessarily of the same underlying schema) which may have references between them.
Support for schema instances is very limited. They are non-persistent and do not support domain equivalence. This will be changed after ROSE has full domain interoperability support
Errors
sdaiSS_NOPN session is not open
sdaiSD_NDEF schema not defined
See Also
ISO 10303-22- 10.5.1; ISO 10303-24- 6.3.2
4.32 sdaiDeleteADB()
void sdaiDeleteADB( SdaiADB block, );
The sdaiDeleteADB() function releases the internal storage associated with an Attribute Data Block(ADB). Any attempt to refer to the ADB handle after calling this function is undefined.
Errors
sdaiSS_NOPN session not open
sdaiAB_NEXS adb is sdaiNULL
See Also
ISO 10303-24- 6.2.12.6
4.33 sdaiDeleteInstance()
void sdaiDeleteInstance( SdaiAppInstance instance );
The sdaiDeleteInstance() function deletes the entity instance specified by parameter instance . Any access to the instance after it has been deleted is undefined.
Errors
sdaiSS_NOPN session not open
sdaiEI_NEXS NULL entity/entity not an application instance
sdaiMX_NRW model not writable
See Also
ISO 10303-22-10.11.2; ISO 10303-24-6.9.3
4.34 sdaiDeleteIterator()
void sdaiDeleteIterator( SdaiIterator iterator );
The sdaiDeleteIterator() function deletes an iterator. Any attempts to access the iterator after it has been deleted are undefined.
Errors
sdaiSS_NOPN session not open
sdaiIR_NEXS iterator NULL
See Also
ISO 10303-22-10.12.4; ISO 10303-24-6.10.4
4.35 sdaiDeleteModel()
void sdaiDeleteModel( SdaiModel model );
The sdaiDeleteModel() function removes a model and all its contents from memory, then permanently removes the model from its repository.
In the " standard_3.0 " filesystem repository, the rose or step file is deleted.
Errors
sdaiSS_NOPN session is not open
sdaiMO_NEXS NULL or invalid model
Example
SdaiModel mod;
:
:
sdaiDeleteModel (mod);
See Also
ISO 10303-22- 10.7.1; ISO 10303-24- 6.5.1
4.36 sdaiDeleteNPL()
void sdaiDeleteNPL( SdaiNPL list );
The sdaiDeleteNPL() function deletes a non-persistent list (NPL). After this function is called, the list handle specified is invalid, and any attempts to use it in any other function are undefined.
Errors
sdaiSS_NOPN session is not open
sdaiAI_NEXS a sdaiNULL handle was passed
Example
see sdaiCreateNPL;
See Also
sdaiCreateNPL();ISO 10303-22- 10.4.13; ISO 10303-24- 6.2.9
4.37 sdaiDeleteSchemaInstance()
void sdaiDeleteSchemaInstance( SdaiSchemaInstance schemaInstance );
The sdaiDeleteSchemaInstance() function deletes a specified schema instance from its repository. Any attempt to use a deleted schema instance in undefined.
Errors
sdaiSS_NOPN session not open
sdaiSI_NEXS schema instance does not exist
See also
ISO 10303-22- 10.6.1; ISO 10303-24- 6.4.1
4.38 sdaiDeleteSchemaInstanceBN()
void sdaiDeleteSchemaInstanceBN ( SdaiString schemaInstanceName, SdaiRep repository );
The sdaiDeleteSchemaInstanceBN() function deletes a schema instance from a repository. The schema instance to be deleted is identified by a name in an open repository. The schema instance is then permanently removed from both memory and from the repository
Errors
sdaiSS_NOPN session not open
sdaiSI_NEXS schema instance does not exist
Example
sdaiDeleteSchemaInstanceBN ("unwanted", repo);
See Also
ISO 10303-22-10.6.1; ISO 10303-24-6.4.1
4.39 sdaiEnd()
void sdaiEnd( SdaiIterator iterator );
The sdaiEnd() function positions an iterator at the end of an aggregate. The iterator's current value in unset. The next call to sdaiPrevious() will set the iterator to the aggregate's last element. This function may only be used on iterators that are traversing ordered aggregates.
Errors
sdaiSS_NOPN session not open
sdaiIR_NEXS iterator NULL
sdaiAI_NVLD iterator is not rewindable
See Also
sdaiBeginning(); sdaiPrevious(); ISO 10303-22-10.15.2; ISO 10303-24-6.13.2
4.40 sdaiEndModelAccess()
void sdaiEndModelAccess( SdaiModel model );
The sdaiEndModelAccess() ends access to a model. The instances in the model may no longer be accessed after this call. Accessing any of the model's instances after this call is undefined. This function does not save the model. If you want the changes to be saved, you must save the model yourself with sdaiSaveChanges() before ending access.
Errors
sdaiSS_NOPN session not open
sdaiMO_NEXS NULL or invalid model
sdaiMX_NDEF model not accessible
Example
SdaiSession sess;
SdaiRep repo;
SdaiModel mod;
:
sess = sdaiOpenSession();
repo = sdaiOpenRepository (sess, "standard_3.0");
:
mod = sdaiAccessModelBN (repo, "modname", sdaiRO);
:
sdaiSaveChanges (mod);
sdaiEndModelAccess (mod);
See Also
sdaiSaveChanges(); ISO 10303-22- 10.7.5, 10.7.7; ISO 10303-24- 6.5.5
4.41 sdaiErrorQuery()
SdaiErrorCode sdaiErrorQuery();
SdaiErrorQuery() returns the error code of the most recent SDAI function to generate an error, then clears the error code. If a session is not open, the function returns sdaiSS_NOPN . If there is no error, it then returns sdaiNO_ERR .
The error code is not cleared by a successful SDAI function call. The only way to clear the error code is to call sdaiErrorQuery() .
Errors
sdaiSS_NOPN session is not open
Example
sdaiErrorQuery () /* clear error code */
sdaiGetAttrBN (inst, "att", sdaiINTEGER, &intval);
errcode = sdaiErrorQuery(); /* Get the error code */
newcode = sdaiErrorQuery(); /* new code == sdaiNO_ERR since
the error was cleared by the previous line*/
See Also
ISO 10303-24- 6.1.3.1;
4.42 sdaiFarCopyInstance()
SdaiAppInstance sdaiFarCopyInstance( SdaiAppInstance instance, SdaiModel model );
The sdaiFarCopyInstance() function creates a new instance within the model identified by parameter model , with the same attribute values as the instance specified by parameter instance .
This function returns a handle to the newly created instance.
Errors
sdaiSS_NOPN session not open
sdaiEI_NEXS NULL entity/entity not an application instance
sdaiSS_NOPN session not open
sdaiMO_NEXS model does not exist, or NULL value passed in
sdaiRP_NOPN model's repo is not open
sdaiMX_NRW model not read-write
See Also
ISO 10303-22-10.11.2; ISO 10303-24-6.9.2
4.43 sdaiFindInstanceRolesOf()
SdaiNPL sdaiFindInstanceRolesOf( SdaiInstance instance, SdaiNPL domain, SdaiNPL resultList );
The sdaiFindInstanceRolesOf() function determines in which attributes a specified instance is referenced as a value from another objects. It then adds the attribute to a specified NPL ( resultList ).
The domain parameter is ignored by this implementation, int the future it will be used to specify the schema instances over which the search is to be performed.
If an error occurs, this function returns sdaiNULL , otherwise it returns the resultList parameter.
Errors
sdaiSS_NOPN session not open
sdaiEI_NEXS NULL entity/entity not an application instance
sdaiAI_NEXS NPL is not valid or NULL
sdaiED_NDEF NPL is not valid or NULL (is isComplex is true)
See Also
ISO 10303-22-10.10.11; ISO 10303-24-6.8.11
4.44 sdaiFindInstanceTypeOf()
SdaiNPL sdaiFindInstanceTypeOf( SdaiInstance instance, SdaiNPL resultList );
The sdaiFindInstanceTypeOf() finds all the types that an instance belongs to. This set of types includes the instance's entity, any supertypes, any SELECT types the entity (or any supertype) belongs to, and any defined types of the selects.
instance- the instance whose types are to be found
resultList- an existing NPL to which the types will be appended. This list will have instances of type entity_definition or defined_type added to it.
If there is no error, this function returns the resultList parameter. If an error occurs sdaiNULL is returned.
Errors
sdaiSS_NOPN session not open
sdaiEI_NEXS NULL entity
sdaiAI_NEXS NPL is not valid or NULL
sdaiED_NDEF NPL is not valid or NULL (is isComplex is true)
See Also
ISO 10303-22-10.10.12; ISO 10303-24-6.8.12
4.45 sdaiFindInstanceUsedIn()
SdaiNPL sdaiFindInstanceUsedIn( SdaiInstance instance, SdaiAttr role, SdaiNPL domain, SdaiNPL resultList );
The sdaiFindInstanceUsedIn() function finds the instances which reference a specified entity instance from a specified attribute. This function searches the instances in the model containing specified instance.
This function searches all instances of the type that have role as an attribute. If that attribute has value instance (or contains instance , where the attribute is an aggregate), then the instance is added to resultList .
Errors
sdaiSS_NOPN session not open
sdaiEI_NEXS NULL entity not Application instance
sdaiAI_NEXS NPL is not valid or NULL
sdaiAT_NDEF NULL attribute
sdaiED_NVLD attribute object is not an attribute
See Also
ISO 10303-22-10.10.9; ISO 10303-24-6.8.9
4.46 sdaiFindInstanceUsedInBN()
SdaiNPL sdaiFindInstanceUsedInBN( SdaiInstance instance, SdaiString roleName, SdaiNPL domain, SdaiNPL resultList );
The sdaiFindInstanceUsedInBN() function finds the instances which reference a specified entity instance from a specified attribute. This function searches the instance in the model containing specified instance.
This function searches all instances of the type that have rolename as an attribute. If that attribute has value instance (or contains instance , where the attribute is an aggregate), then the instance is added to resultList .
Errors
sdaiSS_NOPN session is not open
sdaiEI_NEXS NULL entity not Application instance
sdaiAI_NEXS NPL is not valid or NULL
sdaiAT_NDEF NULL attribute
sdaiED_NVLD attribute object is not an attribute
sdaiAT_NDEF attribute not found, cannot parse roleName
See Also
ISO 10303-22-10.10.9; ISO 10303-24-6.8.9
4.47 sdaiFindInstanceUsers()
SdaiNPL sdaiFindInstanceUsers( SdaiInstance instance, SdaiNPL domain, SdaiNPL resultList );
The sdaiFindInstanceUsers() function finds the instances which reference a specified entity instance. This function searches the instance in the model containing the specified instance. The instance are placed into the specified non-persistent list, resultList .
If the call was successful, this function returns the save value as the parameter resultList . If there is an error, it returns sdaiNULL .
Errors
sdaiSS_NOPN session not open
sdaiEI_NEXS NULL entity or entity not SdaiAppInstance
sdaiAI_NEXS NPL is not valid or NULL
See Also
ISO 10303-22-10.10.8; ISO 10303-24-6.8.8
4.48 sdaiGetADBType()
SdaiPrimitiveType sdaiGetADBType( SdaiADB block );
This function returns the type of the value in an Attribute Data Block.
Errors
SS_NOPN session not open
VT_NVLD cannot convert type
VA_NSET ADB is empty or sdaiNULL value passed in
AB_NEXS adb is sdaiNULL
Example
SdaiADB adb;
switch (sdaiGetADBType(adb)) {
case sdaiINTEGER:
/* value is an integer */
break;
case sdaiREAL:
/* value is a real */
break;
}
See Also
ISO 10303-24- 6.2.12.4
4.49 sdaiGetADBTypePath()
SdaiString * sdaiGetADBTypePath( SdaiADB block, SdaiInteger * typeNameNumber );
The sdaiGetADBTypePath() retrieves the type path in an ADB. This function returns an array of strings containing the type path. The length of this list is placed in the typeNameNumber parameter. The array will persist until the next call to sdaiGetADBTypePath() .
Errors
sdaiAB_NEXS NULL ADB
sdaiSS_NOPN session not open
Example
SdaiADB adb;
int i;
SdaiString * typenames;
SdaiInteger nrtypes = 0;
sdaiGetADBTypePath (adb, &nrtypes);
for (i=0; i<nrtypes; i++) {
SdaiString type = typenames[i];
/* Process the type */
}
See Also
ISO 10303-24-6.18
4.50 sdaiGetADBValue()
void* sdaiGetADBValue( SdaiADB block, SdaiPrimitiveType valueType, void *value);
The sdaiGetADBValue() function gets, converts and returns the value in an Attribute Data Block (ADB). The block parameter specifies the ADB whose value is being retrieved; valueType is the type of the value being retrieved; value is the address where the function will place the value.
If there is an error, this function returns sdaiNULL , otherwise, if the requested type is a primitive, the function returns the parameter value , otherwise, it returns the handle of the instance or aggregate.
Errors
sdaiVT_NVLD ADB value not converted to the requested type
sdaiAB_NEXS ADB is NULL
sdaiVA_NSET ADB is empty or value is NULL
Example
SdaiADB adb;
SdaiReal val;
SdaiInstance instl
/* Do something to set the ADB value */
sdaiGetADBValue (adb, sdaiREAL, &val);
/* Get an instance value */
sdaiGetADBValue (adb, sdaiINSTANCE, &inst);
See Also
ISO 10303-24- 6.2.12.2
4.51 sdaiGetAggrByIndex()
void* sdaiGetAggrByIndex( SdaiOrderedAggr aggregate, SdaiAggrIndex index, SdaiPrimitiveType valueType, void *value );
The sdaiGetAggrByIndex() function retrieves the value from an ordered aggregate by index. This function may only be called on arrays and lists. For other types of aggregates, use an iterator.
The valueType specifies the type of the value parameter. This should be sdaiINTEGER , sdaiREAL , sdaiBOOLEAN , sdaiLOGICAL , sdaiSTRING , sdaiBINARY , sdaiENUM , sdaiINSTANCE , sdaiAGGR , or sdaiADB .
If there is an error, this function returns sdaiNULL , otherwise, if the requested type is a primitive, the function returns the parameter value, otherwise, it returns the handle of the instance or aggregate.
Errors
sdaiSS_NOPN session is not open
sdaiAI_NEXS aggregate does not exist
sdaiAI_NVLD aggregate is not ordered
sdaiVT_NVLD type is invalid
sdaiIX_NVLD bad index
See Also
ISO 10303-22-10.15.1; ISO 10303-24-6.13.1
4.52 sdaiGetAggrByIterator()
void* sdaiGetAggrByIterator( SdaiIterator iterator, SdaiPrimitiveType valueType, void *value );
The sdaiGetAggrByIterator() function returns the current element from an iterator in an aggregate. This is the preferred way to extract data from an aggregate, since it will work on any type of aggregate unlike sdaiGetAggrByIndex() .
The valueType parameter specifies the type of the value parameter. Its value should be should be sdaiINTEGER , sdaiREAL , sdaiBOOLEAN , sdaiLOGICAL , sdaiSTRING , sdaiBINARY , sdaiENUM , sdaiINSTANCE , sdaiAGGR or sdaiADB
If there is an error, this function returns sdaiNULL , otherwise, if the requested type is a primitive, the function return the parameter value, otherwise, it returns the handle of the instance or aggregates.
Errors
sdaiSS_NOPN session not open
sdaiIR_NEXS iterator does not exist
sdaiAI_NEXS aggregate does not exist or is empty
sdaiVT_NVLD type cannot be converted
sdaiIR_NSET ADB is not set to a value
See Also
ISO 10303-22-10.12.7; ISO 10303-24-6.10.7
4.53 sdaiGetAllAttrs()
SdaiADB* sdaiGetAllAttrs( SdaiInstance instance, SdaiInteger *numberAttr );
The sdaiGetAllAttrs() function retrieves all the explicit attributes from an entity instance. This function is only supported for application instances. The attribute are returned as a array of ADB's. The size of this array is placed into the integer referred to by the numberAttr parameter.
This function returns an array of ADBs. The size of the array is returned in the parameter numberAttr . This array and its contents will remain valid until the next call to sdaiGetAllAttrs. Do not call sdaiDeleteADB() on the elements of this array, since they are automatically deleted.
Errors
sdaiSS_NOPN session not open
sdaiEI_NEXS NULL entity/entity not an application instance
sdaiMX_NRW model not read-write
See Also
ISO 10303-24-6.8.13.2
4.54 sdaiGetAttr()
void* sdaiGetAttr( SdaiInstance instance, SdaiAttr attribute, SdaiPrimitiveType valueType, void *value );
The sdaiGetAttr function() returns the value of one of the attributes of an entity instance. The valueType parameter identifies the type of the value parameter. This should be sdaiINTEGER , sdaiREAL , sdaiBOOLEAN , sdaiLOGICAL , sdaiSTRING , sdaiBINARY , sdaiENUM , sdaiINSTANCE , sdaiAGGR , or sdaiADB .
This function will get the values of all explicit attributes. Inverse and derived attributes can only be obtained if the full dictionary is available. See The SDAI Dictionary for more information. For derived attributes, you must link against the sdai_validate library so that the EXPRESS interpreter is available to evaluate the attribute.
If an error was generated, this function returns sdaiNULL , otherwise, if valueType is sdaiINSTANCE , sdaiAGGR , or sdaiADB , a handle for the requested object is returned. Otherwise, the return value is the same pointer as the value parameter.
Errors
sdaiSS_NOPN session is not open
sdaiEI_NEXS entity instance is NULL
sdaiSS_NOPN session not open
sdaiAT_NDEF NULL attribute
sdaiED_NVLD attribute object is not an attribute
sdaiVA_NSET value is not set
sdaiVT_NVLD invalid type
sdaiFN_NAVL derived attribute is not supported
sdaiAT_NVLD attribute is not in instance
Example
SdaiInstance inst;
SdaiAttribute attr;
SdaiInteger intval;
:
:
sdaiGetAttr (inst, att, sdaiINTEGER, &intval);
See Also
sdaiGetAttrBN(); ISO 10303-22- 10.10.1; ISO 10303-24- 6.8.1
4.55 sdaiGetAttrBN()
void* sdaiGetAttrBN( SdaiInstance instance, SdaiString attributeName, SdaiPrimitiveType valueType, void *value );
This function returns the value of one of the attributes of an entity instance. To avoid repeated name lookups, you should use sdaiGetAttr() instead of this function if you will be processing large numbers of objects.
The valueType parameter specifies the type of the value parameter. This should be sdaiINTEGER , sdaiREAL , sdaiBOOLEAN , sdaiLOGICAL , sdaiSTRING , sdaiBINARY , sdaiENUM , sdaiINSTANCE , sdaiAGGR , or sdaiADB .
This function will get the values of all explicit attributes. Inverse and derived attributes can only be obtained if the full dictionary is available. See The SDAI Dictionary for more information. For derived attributes, you must link against the sdai_validate library so that the EXPRESS interpreter is available to evaluate the attribute.
If an error was generated, this function returns sdaiNULL , otherwise, if valueType is sdaiINSTANCE , sdaiAGGR , or sdaiADB , a handle for the requested object is returned. Otherwise, the return value is the same pointer as the value parameter.
Errors
sdaiSS_NOPN session is not open
sdaiEI_NEXT entity instance is NULL
sdaiSS_NOPN session not open
sdaiAT_NDEF NULL attribute
sdaiED_NVLD attribute object is not an attribute
sdaiVA_NSET value is not set
sdaiVT_NVLD invalid type
sdaiFN_NAVL derived attribute is not supported
sdaiAT_NVLD attribute is not in instance
See Also
sdaiGetAttr(); ISO 10303-22- 10.10.1; ISO 10303-24- 6.8.1
4.56 sdaiGetAttrDefinition()
SdaiAttr sdaiGetAttrDefinition( SdaiEntity entity, SdaiString attrName );
The sdaiGetAttrDefinition() function returns one of the attribute definitions of an entity type. The attribute to be found is passed specified in the attrName parameter.
The function returns the attribute definition if found, otherwise sdaiNULL .
Errors
sdaiSS_NOPN session not open.
sdaiED_NDEF entity not defined.
sdaiAT_NDEF attribute not defined for the entity.
See Also
sdaiGetAttrDefinitionBN(); ISO 10303-24- 6.7.5.1
4.57 sdaiGetAttrDefinitionBN()
SdaiAttr sdaiGetAttrDefinitionBN( SdaiString schemaName, SdaiString entityName, SdaiString attrName );
The getGetAttrDefinitionBN() function returns one of the attribute definitions of an entity type.
schemaName- the name of the schema in which to find the entity.
entityName- the name of the entity containing the attribute.
attrName- the name of the attribute within the entity type.
This function returns attribute definition if found, otherwise sdaiNULL .
Errors
sdaiSS_NOPN session not open.
sdaiSD_NDEF schema is not defined.
sdaiED_NDEF entity not defined.
sdaiAT_NDEF attribute not defined for the entity.
See Also
sdaiGetAttrDefinition(); ISO 10303-24- 6.7.5.1
4.58 sdaiGetAttrs()
void sdaiGetAttrs( SdaiInstance instance, SdaiInteger numberAttr, SdaiAttr attribute, SdaiPrimitiveType valueType, void *value, ...);
The sdaiGetAttrs() function gets the values of one or more attributes from an entity instance.
instance- the entity instance from which the attribute are to be retrieved.
numberAttr- the number of attribute to be read.
attribute- the first attribute to be read
valueType- the type of the first attribute.
value- pointer to an object of type specified in valueType where the first value is placed.
...- the parameters attribute valueType and value are repeated for every attribute that is to be read. There must be as many attribute triples as numberAttr .
Errors
sdaiSS_NOPN session is not open
sdaiEI_NEXS entity instance is NULL
sdaiSS_NOPN session not open
sdaiAT_NDEF NULL attribute
sdaiED_NVLD attribute object is not an attribute
sdaiVA_NSET value is not set
sdaiVT_NVLD invalid type
sdaiAT_NVLD attribute is in instance
Example
sdaiGetAttrs (inst, 3,
att1, sdaiINTEGER, &intval,
att2, sdaiSTRING, &strval,
att3, sdaiINSTANCE, &instval);
See Also
sdaiGetAttrsBN(); ISO 10303-24-6.8.13.1
4.59 sdaiGetAttrsBN()
void sdaiGetAttrsBN( SdaiInstance instance, SdaiInteger numberAttr, SdaiString attributeName, SdaiPrimitiveType valueType, void *value, ...);
The sdaiGetAttrsBN() function gets the values of one or more attributes from an entity instance specified by parameter instance .
numberAttr- the number of attributes to be read.
attributeName- the name of the first attribute to be read
valueType- the type of the first attribute.
value- pointer to an object of type specified in valueType where the first value is placed.
...- the parameters attributeName , valueType and value are repeated for every attribute that is to be read. There must be as many attribute triples as numberAttr .
Errors
sdaiSS_NOPN session is not open
sdaiEI_NEXS entity instance is NULL
sdaiSS_NOPN session not open
sdaiAT_NDEF NULL attribute
sdaiED_NVLD attribute object is not an attribute
sdaiVA_NSET value is not set
sdaiVT_NVLD invalid type
sdaiAT_NVLD attribute is in instance
See Also
sdaiGetAttrs(); ISO 10303-24-6.8.13.1
4.60 sdaiGetComplexEntity()
SdaiEntity sdaiGetComplexEntity( SdaiNPL entityList );
The sdaiGetComplexEntity() searches a schema for a complex (AND_OR) entity definition and returns it. The complex type must be declared in the working set when the schema is compiled into the ROSE schema file.
The entityList parameter specifies a non-persistent list consisting of entity_definition instances that represent the supertypes of the complex entity.
This function returns an instance handle to an instance of type entity_definition , where entity_definition identifies the requested complex instance.
Errors
sdaiSS_NOPN session not open
sdaiED_NDEF NPL is not valid or NULL or list is empty, entity not in schema
sdaiED_NVLD an entity in the list is not valid
See Also
ISO 10303-22-10.9.1; ISO 10303-24-6.7.1
4.61 sdaiGetComplexEntityBN()
SdiaEntity sdaiGetComplexEntityBN( SdaiString schemaName, SdaiInteger nameNumber, SdaiString *nameVector );
The sdaiGetComplexEntityBN() function returns the entity_definition , if any, for the entity data type composed of the entity types whose names are supplied. The entity type to be returned must have been compiled into the ROSE schema using the working set option of expfront . This function will not construct a complex entity "on the fly".
schemaName- the name of the schema in which to find entity definitions.
nameNumber- the number of entity names supplied in the nameVector argument.
nameVector- pointer to a vector of entity names.
This function returns the corresponding entity definition if it exists, otherwise sdaiNULL .
Errors
sdaiSS_NOPN session not open.
sdaiSD_NDEF schema is not defined.
sdaiED_NDEF list of names is NULL or empty, or entity is not in the schema.
sdaiED_NVLD an entity name in the list is not valid.
See Also
ISO 10303-22- 10.9.1; ISO 10303-24- 6.7.1
4.62 sdaiGetDescription()
SdaiString sdaiGetDescription( SdaiAppInstance instance, SdaiString descriptionBuffer );
The sdaiGetDescription() function gets a human-readable description of an entity instance specified by parameter instance . In this implementation, this function returns the instance's type. The description is a NULL terminated string, and is placed into descriptionBuffer . This buffer should be at least 1024 characters.
This function returns the descriptionBuffer parameter.
Errors
sdaiSS_NOPN session not open
sdaiEI_NEXS NULL entity/entity not an application instance
See Also
ISO 10303-22-10.11.8; ISO 10303-24-6.9.9
4.63 sdaiGetEntity()
SdaiEntity sdaiGetEntity( SdaiModel model, SdaiString name );
The sdaiGetEntity() function finds an entity definition by name in a model's schema. This function looks in the model's schema for an entity_definition instance with the specified name.
This function returns an instance of entity_definition , if the instance could be found. Otherwise, it returns sdaiNULL and flags an error.
Errors
sdaiSS_NOPN session not open
sdaiMO_NEXS NULL or invalid model
sdaiMX_NDEF model not accessible
sdaiED_NDEF cannot find entity or NULL name
Example
SdaiSession sess;
SdaiRep repo;
SdaiModel mod;
SdaiEntity ent;
:
sess = sdaiOpenSession();
repo = sdaiOpenRepository (sess, "standard_3.0");
mod = sdaiAccessModelBN (repo, "modname", sdaiRO);
:
ent = sdaiGetEntity (mod, "cartesian_point");
See Also
ISO 10303-22- 10.7.8; ISO 10303-24- 6.5.6
4.64 sdaiGetEntityExtent()
SdaiSet sdaiGetEntityExtent( SdaiModel model, SdaiEntity entity );
The sdaiGetEntityExtent() function gets an entity extent for a model. An entity extent is the set of all instances of a specified entity (or its subtypes). The entity extents may also be obtained by examining model.contents.folders , however this function is more convenient.
This function returns an object of type SdaiSet containing all the objects of the requested type.
Errors
sdaiSS_NOPN session not open
sdaiMO_NEXS model does not exist, or NULL value passed in
sdaiRP_NOPN model's repo is not open
sdaiED_NDEF entity definition NULL or not defined
sdaiMX_NDEF model access not defined
See Also
ISO 10303-24- 6.5.10.2; sdaiGetEntityExtentBN()
4.65 sdaiGetEntityExtentBN()
SdaiSet sdaiGetEntityExtentBN( SdaiModel model, SdaiString entityName );
The sdaiGetEntityExtentBN() function gets an entity extent for a model. An entity extent is the set of all instances of a specified entity (or its subtypes). The entity extents may also be obtained by examining model.contents.folders . The type is specified by name as the parameter entityName .
This function returns an object of type SdaiSet containing all the objects of the requested type.
Errors
sdaiSS_NOPN session not open
sdaiMO_NEXS model does not exist, or NULL value passed in
sdaiRP_NOPN model's repo is not open
sdaiED_NDEF entity definition NULL or not defined
sdaiMX_NDEF model access not defined
See Also
ISO 10303-24- 6.5.10.2; sdaiGetEntityExtent();
4.66 sdaiGetInstanceModel()
SdaiModel sdaiGetInstanceModel( SdaiInstance instance );
The sdaiGetInstancemodel() function returns the model containing the instance specified by parameter instance .
This functions returns a handle for the instance's model. If there is an error, it returns sdaiNULL .
Errors
sdaiSS_NOPN session not open
sdaiEI_NEXS entity instance does not exist
sdaiMO_NEXS instance has no model
See Also
ISO 10303-22-6.8.3; ISO 10303-24-10.10.3
4.67 sdaiGetInstanceType()
SdaiEntity sdaiGetInstanceType( SdaiInstance instance );
The sdaiGetInstanceType() function returns the type ( entity_definition ) on an entity instance.
This function returns a handle to an instance of type SdaiEntity .
Errors
sdaiSS_NOPN session not open
sdaiEI_NEXS NULL entity
See Also
ISO 10303-22-10.10.4; ISO 10303-24-6.8.4
4.68 sdaiGetLowerIndex()
SdaiInteger sdaiGetLowerIndex( SdaiArray array );
The sdaiGetLowerIndex() function determines the lower index in an array. EXPRESS allows arrays to have user-defined upper and lower bounds, and this function returns the lower bound of an array. In this implementation, arrays always begin at zero, and so this function always returns 0.
Errors
sdaiSS_NOPN session is not open
sdaiAI_NEXS aggregate does not exist
sdaiAI_NVLD aggregate is not an array
ISO 10303-22-10.17.3; ISO 10303-24-6.15.3
4.69 sdaiGetMemberCount()
SdaiInterger sdaiGetMemberCount( SdaiAggr aggregate );
The sdaiGetMemberCount() function returns a count of the number of elements in an aggregate.
Errors
sdaiSS_NOPN session not open.
sdaiAI_NEXS the aggregate does not exist.
See Also
ISO 10303-22- 10.12.1; ISO 10303-24- 6.10.1
4.70 sdaiGetPersistentLabel()
SdaiString sdaiGetPersistentLabel( SdaiAppInstance instance, SdaiString labelBuffer );
The sdaiGetPersistentLabel () function returns a persistent identifier for an application instance. The persistent label is a string of at most 256 characters, and is placed into the memory pointed to by the labelBuffer parameter.
Errors
sdaiSS_NOPN session not open.
sdaiAI_NEXS the aggregate does not exist.
See also
sdaiGetSessionId(); ISO 10303 - 22-10.11.6; ISO 10303 - 24-6.9.7
4.71 sdaiGetSessionId()
SdaiAppInstance sdaiGetSessionId( SdaiRep repository, SdaiString label );
The sdaiGetSessionId() function finds that instance which has a specific persistent label in the repository specified by the parameter repository .
Errors
sdaiSS_NOPN session not open
sdaiEI_NEXS entity instance was not found
See also
sdaiGetPersistentLabel(); ISO 10303 - 22-10.11.7; ISO 10303 - 24-6.9.8
4.72 sdaiGetSchema()
SdaiSchema sdaiGetSchema( SdaiString schemaName );
The sdaiGetSchema() function finds and returns a schema definition by name. If the dictionary does not exist, this function generates it from the rose schema file, and possibly the EXPRESS parse data. It returns the appropriate schema_definition object from the dictionary model.
If successful, this function returns the handle of the appropriate schema_definition entity. Otherwise, it returns sdaiNULL .
Errors
sdaiSS_NOPN session not open
sdaiSD_NDEF cannot find schema or NULL value
sdaiRP_NOPN repository is not open
Example
SdaiSchema sch;
sch = sdaiGetSchema (schemaName);
See Also
ISO 10303-24- 6.4.10.1
4.73 sdaiGetSchemaInstance()
SdaiSchemaInstance sdaiGetSchemaInstance( DdaiString schemaInstanceName, SdaiRep repository );
The sdaiGetSchemaInstance() function finds a schema instance by name in a repository.
Errors
sdaiSS_NOPN session not open
sdaiRP_NEXS NULL or invalid repo
sdaiRP_NOPN repository is not open
sdaiSI_NEXS could not find schema instance
Example
SdaiSchemaInstance si;
si = sdaiGetSchemaInstance ("siname", rep);
See Also
ISO 10303-24-6.4.10.2
4.74 sdaiGetUpperIndex()
SdaiInteger sdaiGetUpperIndex( SdaiArray array );
The sdaiGetUpperIndex() function returns the maximum index value in an array. This function returns the highest index at which an element may be placed. (In this implementation, the upper index is one less than the size of the array.)
Errors
sdaiSS_NOPN session is not open
sdaiAI_NEXS aggregate does not exist
sdaiAI_NVLD aggregate is not an array
See Also
ISO 10303-22-10.17.4; ISO 10303-24-6.15.4
4.75 sdaiInsertAfter()
void sdaiInsertAfter( SdaiIterator iterator, SdaiPrimitiveType valueType, <TYPE> value);
The sdaiInsertAfter() function inserts a value into an ordered aggregate after the current position of an iterator.
Errors
sdaiSS_NOPN session not open
sdaiIR_NEXS iterator NULL
sdaiAI_NVLD aggregate/iterator not writable
sdaiMX_NRW write permission denied
sdaiIR_NSET iterator has no current member
sdaiAI_NVLD aggregate is invalid
sdaiVT_NVLD invalid type
See also
ISO 10303-22-10.19.2; ISO 10303-24-6.17.2
4.76 sdaiInsertBefore()
void sdaiInsertBefore( SdaiIterator iterator, SdaiPrimitiveType valueType, <TYPE> value );
The sdaiInsertBefore() function inserts value into an ordered aggregate before the current value in an iterator.
Errors
sdaiSS_NOPN session not open
sdaiIR_NEXS iterator NULL
sdaiAI_NVLD aggregate/iterator not writable
sdaiMX_NRW: write permission denied
sdaiIR_NSET iterator has no current member
sdaiAI_NVLD aggregate is invalid
sdaiVT_NVLD invalid type
See Also
ISO 10303-22-10.19.1; ISO 10303-24-6.17.1
4.77 sdaiInsertByIndex()
void sdaiInsertByIndex( SdaiList list, SdaiAggrIndex index, SdaiPrimitiveType valueType, <TYPE> value);
The sdaiInsertByIndex() function inserts a value into a list at the specified index.
Errors
sdaiSS_NOPN session is not open
sdaiAI_NEXS aggregate does not exist
sdaiAI_NVLD aggregate is internal and thus not writable
sdaiMX_NRW model is not writable
sdaiIX_NVLD index not valid
sdaiAI_NVLD aggregate not valid
sdaiVT_NVLD type invalid
See Also
ISO 10303-22-10.19.3; ISO 10303-24-6.17.3
4.78 sdaiInsertNestedAggrAfter()
SdaiAggr sdaiInsertNestedAggrAfter( SdaiIterator iterator );
The sdaiInsertNestedAggrAfter() function creates a nested aggregate and inserts a value into an aggregate after the current value.
This function returns the newly created aggregate
Errors
sdaiSS_NOPN session not open
sdaiIR_NEXS iterator NULL
sdaiAI_NVLD aggregate/iterator not writable
sdaiMX_NRW: write permission denied
See Also
ISO 10303-22-10.19.5; ISO 10303-24-6.17.5
4.79 sdaiInsertNestedAggrAfterADB()
SdaiAggr sdaiInsertNestedAggrAfterADB( SdaiIterator iterator, SdaiADB selaggrInstance );
The sdaiInsertNestedAggrAfterADB() function creates and inserts an aggregate into an aggregate after the current value of an iterator. The selaggrInstance is an ADB identifying the type of the aggregate to be created in the event the elements of the aggregates are SELECTS. This ADB is also populated with the newly created aggregate.
This function returns the newly created aggregate
Errors
sdaiSS_NOPN session not open
sdaiIR_NEXS iterator NULL
sdaiAI_NVLD aggregate/iterator not writable
sdaiMX_NRW: write permission denied
See Also
ISO 10303-22-10.19.5; ISO 10303-24-6.17.5
4.80 sdaiInsertNestedAggrBefore()
SdaiAggr sdaiInsertNestedAggrBefore( SdaiIterator iterator );
The sdaiInsertNestedAggrBefore() function creates and inserts a new aggregate instance into the aggregate specified by the iterator before the current value of the iterator.
This function returns the newly created aggregate.
Errors
sdaiSS_NOPN session not open
sdaiIR_NEXS iterator NULL
sdaiAI_NVLD aggregate/iterator not writable
sdaiMX_NRW: write permission denied
See Also
ISO 10303-22-10.19.4; ISO 10303-24-6.17.4
4.81 sdaiInsertNestedAggrBeforeADB()
SdaiAggr sdaiInsertNestedAggrBeforeADB( SdaiIterator iterator, SdaiADB selaggrInstance );
The sdaiInsertNestedAggrBeforeADB() function creates and inserts a new aggregate instance into an aggregate before the current value.
The selaggrInstance parameter is an ADB which identifies the type of the aggregate to be created in the event the elements of the aggregates are SELECTS. This ADB is also populated with the newly created aggregate.
This function returns the newly created aggregate.
Errors
sdaiSS_NOPN session not open
sdaiIR_NEXS iterator NULL
sdaiAI_NVLD aggregate/iterator not writable
sdaiMX_NRW write permission denied
See Also
ISO 10303-22-10.19.4; ISO 10303-24-6.17.4
4.82 sdaiInsertNestedAggrByIndex()
SdaiAggr sdaiInsertNestedAggrByIndex( SdaiList list, SdaiAggrIndex index );
The sdaiInsertNestedAggrByIndex() function creates and inserts a new aggregate instance into an existing aggregate.
The function returns new newly created aggregate.
Errors
sdaiSS_NOPN session is not open
sdaiAI_NEXS aggregate does not exist
sdaiAI_NVLD aggregate is internal and thus not writable
sdaiMX_NRW model is not writable
See Also
ISO 10303-22-10.19.6; ISO 10303-24-6.17.6
4.83 sdaiInsertNesterAggrByIndexADB()
SdaiAggr sdaiInsertNestedAggrByIndexADB( SdaiList list, SdaiAggrIndex index, SdaiADB selaggrInstance );
The sdaiInsertNestedAggrByIndexADB() function creates and inserts a new aggregate instance into an existing aggregate.
The selaggrInstance parameter specifies an ADB identifying the type of the aggregate to be created in the event the elements of the aggregates are SELECTS. This ADB is also populated with the newly created aggregate.
The function returns the newly created aggregate.
Errors
sdaiAB_NEXS NULL ADB
sdaiSS_NOPN session is not open
sdaiAI_NEXS aggregate does not exist
sdaiAI_NVLD aggregate is internal and thus not writable
sdaiMX_NRW model is not writable
See Also
ISO 10303-22-10.19.6; ISO 10303-24-6.17.6
4.84 sdaiIsInstanceOf()
SdaiBoolean sdaiIsInstanceOf( SdaiInstance instance, SdaiEntity entity );
The sdaiIsInstanceOf() function determines whether an instance is of a specified type. For this function to return true, the instance must be an instance of the specified entity definition (parameter entity ), and not a subtype.
If instance is an instance of entity this function return sdaiTRUE , otherwise it returns sdaiFALSE . If an error occurs, it returns sdaiFALSE .
Errors
sdaiSS_NOPN session not open
sdaiEI_NEXS NULL entity
See Also
ISO 10303-22-10.10.5; ISO 10303-24-6.8.5
4.85 sdaiIsInstanceOfBN()
SdaiBoolean sdaiIsInstanceOfBN( SdaiInstance instance, SdaiString entityName );
The sdaiIsInstanceOfBN() function determines whether an instance is of a specified type. For this function to return true, the instance must be an instance of the type, and not a subtype.
If instance is an instance of the entity specified by parameter entityName this function returns sdaiTRUE , otherwise it returns sdaiFALSE . If an error occurs, it returns sdaiFALSE .
Errors
sdaiSS_NOPN session not open
sdaiEI_NEXS NULL entity
sdaiED_NDEF entity definition NULL or not defined
See Also
ISO 10303-22-10.10.5; ISO 10303-24-6.8.5
4.86 sdaiIsEqual()
SdaiBoolean sdaiIsEqual( SdaiInstance inst1, SdaiInstance inst2 );
The sdaiIsEqual() function determines if two instance handles refer to the same underlying entity instance.
Example
SdaiInstance foo;
SdaiInstance bar;
if (sdaiIsEqual(foo, bar)) {
printf ("Equal\n");
}
See Also
ISO 10303-24-6.1.4.1
4.87 sdaiIsKindOf()
SdaiBoolean sdaiIsKindOf( SdaiInstance instance, SdaiEntity entity );
The sdaiIsKindOf() function determines whether an instance is of a specified type or one of its subtypes.
instance- the instance to be tested
entity- the type to compare.
This function returns sdaiTRUE if instance is an instance of entity of is one of its subtypes. Otherwise, it returns sdaiFALSE .
Errors
sdaiSS_NOPN session not open
sdaiEI_NEXS NULL entity
See Also
ISO 10303-22-10.10.6; ISO 10303-24-6.8.6
4.88 sdaiIsKindOfBN()
SdaiBoolean sdaiIsKindOfBN( SdaiInstance instance, SdaiString entityName );
The sdaiIsKindOfBN() function determines whether an instance is of a specified type or one of its subtypes.
instance- the instance to be tested
entityName- name of the type to compare.
This function return sdaiTRUE if instance is an instance of entity of is one of its subtypes. Otherwise, it returns sdaiFALSE .
Errors
sdaiSS_NOPN session not open
sdaiEI_NEXS NULL entity
sdaiED_NDEF entity definition NULL or not defined
See Also
ISO 10303-22-10.10.6; ISO 10303-24-6.8.6
4.89 sdaiIsMember()
SdaiBoolean sdaiIsMember( SdaiAggr aggregate, SdaiPrimitiveType valueType, <TYPE> value );
The sdaiIsMember() function determines whether a given value is present as an element of a given aggregate.
This function returns sdaiTRUE if the given value is present in the aggregate, sdaiFALSE if not or if error.
Errors
sdaiSS_NOPN session not open.
sdaiVT_NVLD the given value could not be converted appropriate type
sdaiAI_NEXS the aggregate does not exist.
See Also
ISO 10303-22- 10.12.2; ISO 10303-24- 6.10.2
4.90 sdaiIsSDAIKindOf()
SdaiBoolean sdaiIsSDAIKindOf( SdaiInstance instance, SdaiEntity entity );
The sdaiIsSDAIsKindOf() function determines whether an instance is of a specified type or one of its subtypes. This function also considers the type hierarchy is in SDAI population schema.
This function return sdaiTRUE if instance is an instance of entity of is one of its subtypes. Otherwise, it returns sdaiFALSE .
Errors
sdaiSS_NOPN session not open
sdaiEI_NEXS NULL entity
See Also
ISO 10303-22-10.10.7; ISO 10303-24-6.8.7
4.91 sdaiIsSDAIKindOfBN
SdaiBoolean sdaiIsSDAIKindOfBN( SdaiInstance instance, SdaiString entityName );
The sdaiIsSDAIKindOfBN() function determines whether an instance is of a specified type or one of its subtypes. This function also considers the type hierarchy is in SDAI population schema. (That is, the inheritance hierarchy is rooted at entity_instance , rather than an entity without any supertypes.)
This function return sdaiTRUE if instance is an instance of entity of is one of its subtypes. Otherwise, it returns sdaiFalse .
Errors
sdaiSS_NOPN session not open
sdaiEI_NEXS NULL entity
sdaiED_NDEF entity definition NULL or not defined
See Also
ISO 10303-22-10.10.7; ISO 10303-24-6.8.7
4.92 sdaiIsSDAISubtypeOf
SdaiBoolean sdaiIsSDAISubtypeOf( SdaiEntity subtype, SdaiEntity supertype );
This function determines whether an entity is a subtype of (or the same as) another entity. SDAI-specific entities are allowed. (That is, the inheritance hierarchy is rooted at entity_instance , rather than an entity without any supertypes.)
The function returns sdaiTRUE if the types are the same or if subtype is a subtype of supertype ; sdaiFALSE otherwise.
Errors
sdaiSS_NOPN session not open.
sdaiED_NDEF an entity is not defined.
See Also
ISO 10303-22- 10.9.3; ISO 10303-24- 6.7.3
4.93 sdaiIsSDAISubtypeOfBN()
SdaiBoolean sdaiIsSDAISubtypeOfBN( SdaiString schemaName, SdaiString subName, SdaiString superName );
The sdaiIsSDAISubtypeOfBN() function determines whether an entity is a subtype of (or the same as) another entity. SDAI-specific entity names are allowed.
This function returns sdaiTRUE if the types are the same or if subName names a subtype of superName ; sdaiFALSE otherwise.
Errors
sdaiSS_NOPN session not open.
sdaiSD_NDEF schema is not defined.
sdaiED_NDEF an entity is not defined.
See Also
ISO 10303-22- 10.9.3; ISO 10303-24- 6.7.3
4.94 sdaiIsSubtypeOf()
SdaiBoolean sdaiIsSubtypeOf( SdaiEntity subtype, SdaiEntity supertype );
This function determines whether an entity is a subtype of (or the same as) another entity.
This function returns sdaiTRUE if the types are the same or if subtype is a subtype of supertype , sdaiFALSE otherwise.
Errors
sdaiSS_NOPN session not open.
sdapED_NDEF an entity is not defined.
See Also
ISO 10303-22- 10.9.2; ISO 10303-24- 6.7.2
4.95 sdaiIsSubtypeOfBN()
SdaiBoolean sdaiIsSubtypeOfBN( SdaiString schemaName, SdaiString subName, SdaiString superName );
The sdaiIsSubtypeOfBN() function determines whether an entity is a subtype of (or the same as) another entity.
This function returns sdaiTRUE if the types are the same or if subName names a subtype of superName , otherwise it returns sdaiFALSE .
Errors
sdaiSS_NOPN session not open.
sdaiSD_NDEF schema is not defined.
sdaiED_NDEF an entity is not defined.
See Also
ISO 10303-22- 10.9.2; ISO 10303-24- 6.7.2
4.96 sdaiLogicalCompare()
int sdaiLogicalCompare( SdaiLogical value1, SdaiLogical value2 );
sdaiLogicalCompare() compares two logical values. Logical values are defined such that
sdaiFALSE < sdaiUNKNOWN < sdaiTRUE
The function returns 0, +1 or -1 according to the following:
value1 < value2 -1
value1 == value2 0
value1 > value2 +1
Unlike most other SDAI functions, sdaiLogicalCompare() can be called when there is no open session.
Errors
This function does not generate SDAI errors under any conditions.
Example
The following call:
val = sdaiLogicalCompare (sdaiFalse, sdaiUNKNOWN);
Returns the value -1
See Also
ISO 10303-24- 6.1.2.1
4.97 sdaiNearCopyInstance()
SdaiAppInstance sdaiNearCopyInstance( SdaiAppInstance instance );
The sdaiNearCopyInstance() function creates a new instance within the same model and with the same attribute values as an instance .
This function returns a handle to the newly created instance.
Errors
sdaiSS_NOPN session not open
sdaiEI_NEXS NULL entity/entity not an application instance
See Also
ISO 10303-22-10.11.1; ISO 10303-24-6.9.1
4.98 sdaiNext()
SdaiBoolean sdaiNext( SdaiIterator iterator );
The sdaiNext() function advances an iterator to the next element. In a newly created iterator, or after sdaiBeginning() has been called, the first call to sdaiNext will advance the iterator to the first element.
This function returns a boolean value indicating whether or not the iterator was advanced to the next element. This allows sdaiNext() to be easily used in a while loop to iterate over all the aggregate's elements.
Errors
sdaiSS_NOPN session not open
sdaiIR_NEXS iterator does not exist
sdaiAI_NEXS aggregate does not exist or is empty
Example
/*To iterate over every element in an aggregate: */
SdaiIterator itor;
itor = sdaiCreateIterator (aggr);
while (sdaiNext (itor)) {
/* Get the value (replace TYPE with the aggregate type) */
sdaiGetAggrByIterator (itor, TYPE, &value);
/* Now process the element */
}
sdaiDeleteIterator(itor);
See Also
ISO 10303-22-10.12.6; ISO 10303-24-6.10.6
4.99 sdaiOpenRepository()
SdaiRep sdaiOpenRepository( SdaiSession session SdaiRep repository );
The sdaiOpenRepository() function opens a repository and makes it possible to create and access models in that repository. The repository handle may be obtained from the session object in the attribute known_servers . If you know the name of the repository to open, it may be more convenient to use sdaiOpenRepositoryBN .
The function returns the handle of the newly opened repository.
Errors
sdaiSS_NOPN session is not open