...

Model input parameter is irrelevant, but is required for backwards compatibility.

Technically xxxxGetEntityAndSubTypesExtentBN will transform into the following call

    xxxxGetEntityAndSubTypesExtent(
            model,
            sdaiGetEntity(
                    model,
                    entityName
                )
        );

This call returns an aggregation containing all instances.

This call returns an aggregation containing all instances referencing the given instance. note: this is independent from if there are inverse relations defining such an aggregation or parts of it.

...

...

This function iterates over all available instances loaded in memory, it is the fastest way to find all instances. Argument entity and entityName are both optional and if non-zero are filled with respectively the entity handle and entity name as char array.

valueType argument to specify what type of data caller wants to get and value argument where the caller should provide a buffer, and the function will write the result to. Table 1 shows type of buffer the caller should provide depending on the valueType for sdaiGetAggrByIterator, and it works similarly for all get-functions. Note: with SDAI API it is impossible to check buffer type at compilation or execution time and this is responsibility of a caller to ensure that requested valueType is matching with the value argument, a mismatch will lead to unpredictable results. The Table 2 shows what valueType can be fulfilled depending on actual model data. On success get-function will return non-zero. More precisely, according to ISO 10303-24-2001 on success they return content of value argument (*value) for sdaiADB, sdaiAGGR, or sdaiINSTANCE or value argument itself for other types (it has no useful meaning for C#). All get-functions return NULL and set value to 0 if model data are incompatible with requested valueType. Furthermore: - for unset ($) data all get-functions return NULL and set value to 0, except when valueType = sdaiEXPRESSSTRING - for derived (*), depending on engiEnableDerivedAttributes, and except valueType = sdaiEXPRESSSTRING: -- either calculate and follow these rues for calculated value -- or handles it as unset ($) - if valueType = sdaiEXPRESSSTRING and data is unset ($) or derived (*), get-function will return NULL but set value to "$" or "*" respectively for any engiEnableDerivedAttributes state

Table 1 – Required value buffer depending on valueType (on the example of sdaiGetAggrByIterator but valid for all get-functions)

valueType               C/C++                                                           C#

sdaiINTEGER             int_t val;                                                      int_t val;
                        sdaiGetAggrByIterator (iterator, sdaiINTEGER, &val);            ifcengine.sdaiGetAggrByIterator (iterator, ifcengine.sdaiINTEGER, out val);

sdaiREAL or sdaiNUMBER  double val;                                                     double val;
                        sdaiGetAggrByIterator (iterator, sdaiREAL, &val);               ifcengine.sdaiGetAggrByIterator (iterator, ifcengine.sdaiREAL, out val);

sdaiBOOLEAN             SdaiBoolean val;                                                bool val;
                        sdaiGetAggrByIterator (iterator, sdaiBOOLEAN, &val);            ifcengine.sdaiGetAggrByIterator (iterator, ifcengine.sdaiBOOLEAN, out val);

sdaiLOGICAL             const TCHAR* val;                                               string val;
                        sdaiGetAggrByIterator (iterator, sdaiLOGICAL, &val);            ifcengine.sdaiGetAggrByIterator (iterator, ifcengine.sdaiLOGICAL, out val);

sdaiENUM                const TCHAR* val;                                               string val;
                        sdaiGetAggrByIterator (iterator, sdaiENUM, &val);               ifcengine.sdaiGetAggrByIterator (iterator, ifcengine.sdaiENUM, out val);

sdaiBINARY              const TCHAR* val;                                               string val;
                        sdaiGetAggrByIterator (iterator, sdaiBINARY, &val);             ifcengine.sdaiGetAggrByIterator (iterator, ifcengine.sdaiBINARY, out val);

sdaiSTRING              const char* val;                                                string val;
                        sdaiGetAggrByIterator (iterator, sdaiSTRING, &val);             ifcengine.sdaiGetAggrByIterator (iterator, ifcengine.sdaiSTRING, out val);

sdaiUNICODE             const wchar_t* val;                                             string val;
                        sdaiGetAggrByIterator (iterator, sdaiUNICODE, &val);            ifcengine.sdaiGetAggrByIterator (iterator, ifcengine.sdaiUNICODE, out val);

sdaiEXPRESSSTRING       const char* val;                                                string val;
                        sdaiGetAggrByIterator (iterator, sdaiEXPRESSSTRING, &val);      ifcengine.sdaiGetAggrByIterator (iterator, ifcengine.sdaiEXPRESSSTRING, out val);

sdaiINSTANCE            SdaiInstance val;                                               int_t val;
                        sdaiGetAggrByIterator (iterator, sdaiINSTANCE, &val);           ifcengine.sdaiGetAggrByIterator (iterator, ifcengine.sdaiINSTANCE, out val);

sdaiAGGR                SdaiAggr aggr;                                                  int_t aggr;
                        sdaiGetAggrByIterator (iterator, sdaiAGGR, &aggr);              ifcengine.sdaiGetAggrByIterator (iterator, ifcengine.sdaiAGGR, out aggr);

sdaiADB                 SdaiADB adb = sdaiCreateEmptyADB();                             int_t adb = 0;  //  it is important to initialize
                        sdaiGetAggrByIterator (iterator, sdaiADB, adb);                 ifcengine.sdaiGetAggrByIterator (iterator, ifcengine.sdaiADB, out adb);     
                        sdaiDeleteADB (adb);

                        SdaiADB adb = nullptr;  //  it is important to initialize
                        sdaiGetAggrByIterator (iterator, sdaiADB, &adb);
TCHAR is “char” or “wchar_t” depending on setStringUnicode. (Non-standard behavior) sdaiLOGICAL behaves differently from ISO 10303-24-2001: it expects char* while standard declares int_t. (Non-standard extension) sdiADB in C++ has an option to work without sdaiCreateEmptyADB and sdaiDeleteADB as shown in the table.
Table 2 - valueType can be requested depending on actual model data.

valueType       Works for following values in the model
                  integer      real     .T. or .F.     .U.      other enum    binary      string     instance      list
sdaiINTEGER         Yes         Yes *        .           .           .           .           .           .           .
sdaiREAL            Yes         Yes          .           .           .           .           .           .           .
sdaiNUMBER          Yes         Yes          .           .           .           .           .           .           .
sdaiBOOLEAN          .           .          Yes          .           .           .           .           .           .
sdaiLOGICAL          .           .          Yes         Yes          .           .           .           .           .
sdaiENUM             .           .          Yes         Yes         Yes          .           .           .           .
sdaiBINARY           .           .           .           .           .          Yes          .           .           .
sdaiSTRING          Yes         Yes         Yes         Yes         Yes         Yes         Yes          .           .
sdaiUNICODE         Yes         Yes         Yes         Yes         Yes         Yes         Yes          .           .
sdaiEXPRESSSTRING   Yes         Yes         Yes         Yes         Yes         Yes         Yes          .           .
sdaiINSTANCE         .           .           .           .           .           .           .          Yes          .
sdaiAGGR             .           .           .           .           .           .           .           .          Yes
sdaiADB             Yes         Yes         Yes         Yes         Yes         Yes         Yes         Yes         Yes

(Non-standard extensions) sdaiGetADBValue: sdaiADB is allowed and will success when sdaiGetADBTypePath is not NULL, returning ABD value has type path element removed.

valueType argument to specify what type of data caller wants to put Table 1 shows type of buffer the caller should provide depending on the valueType for sdaiPutAggrByIterator, and it works similarly for all put-functions. Note: with SDAI API it is impossible to check buffer type at compilation or execution time and this is responsibility of a caller to ensure that requested valueType is matching with the value argument, a mismatch will lead to unpredictable results.

Table 1 – Required value buffer depending on valueType (on the example of sdaiPutAggrByIterator but valid for all put-functions)

valueType               C/C++                                                       C#

sdaiINTEGER             int_t val = 123;                                            int_t val = 123;
                        sdaiPutAggrByIterator (iterator, sdaiINTEGER, &val);        ifcengine.sdaiPutAggrByIterator (iterator, ifcengine.sdaiINTEGER, ref val);

sdaiREAL or sdaiNUMBER  double val = 123.456;                                       double val = 123.456;
                        sdaiPutAggrByIterator (iterator, sdaiREAL, &val);           ifcengine.sdaiPutAggrByIterator (iterator, ifcengine.sdaiREAL, ref val);

sdaiBOOLEAN             SdaiBoolean val = sdaiTRUE;                                 bool val = true;
                        sdaiPutAggrByIterator (iterator, sdaiBOOLEAN, &val);        ifcengine.sdaiPutAggrByIterator (iterator, ifcengine.sdaiBOOLEAN, ref val);

sdaiLOGICAL             const TCHAR* val = "U";                                     string val = "U";
                        sdaiPutAggrByIterator (iterator, sdaiLOGICAL, val);         ifcengine.sdaiPutAggrByIterator (iterator, ifcengine.sdaiLOGICAL, val);

sdaiENUM                const TCHAR* val = "NOTDEFINED";                            string val = "NOTDEFINED";
                        sdaiPutAggrByIterator (iterator, sdaiENUM, val);            ifcengine.sdaiPutAggrByIterator (iterator, ifcengine.sdaiENUM, val);

sdaiBINARY              const TCHAR* val = "0123456ABC";                            string val = "0123456ABC";
                        sdaiPutAggrByIterator (iterator, sdaiBINARY, val);          ifcengine.sdaiPutAggrByIterator (iterator, ifcengine.sdaiBINARY, val);

sdaiSTRING              const char* val = "My Simple String";                       string val = "My Simple String";
                        sdaiPutAggrByIterator (iterator, sdaiSTRING, val);          ifcengine.sdaiPutAggrByIterator (iterator, ifcengine.sdaiSTRING, val);

sdaiUNICODE             const wchar_t* val = L"Any Unicode String";                 string val = "Any Unicode String";
                        sdaiPutAggrByIterator (iterator, sdaiUNICODE, val);         ifcengine.sdaiPutAggrByIterator (iterator, ifcengine.sdaiUNICODE, val);

sdaiEXPRESSSTRING       const char* val = "EXPRESS format, i.e. \\X2\\00FC\\X0\\";  string val = "EXPRESS format, i.e. \\X2\\00FC\\X0\\";
                        sdaiPutAggrByIterator (iterator, sdaiEXPRESSSTRING, val);   ifcengine.sdaiPutAggrByIterator (iterator, ifcengine.sdaiEXPRESSSTRING, val);

sdaiINSTANCE            SdaiInstance val = sdaiCreateInstanceBN (model, "IFCSITE"); int_t val = ifcengine.sdaiCreateInstanceBN (model, "IFCSITE");
                        sdaiPutAggrByIterator (iterator, sdaiINSTANCE, val);        ifcengine.sdaiPutAggrByIterator (iterator, ifcengine.sdaiINSTANCE, val);

sdaiAGGR                SdaiAggr val = sdaiCreateAggr (inst, 0);                    int_t val = sdaiCreateAggr (inst, 0);
                        sdaiPutAttr (val, sdaiINSTANCE, inst);                      ifcengine.sdaiPutAttr (val, ifcengine.sdaiINSTANCE, inst);
                        sdaiPutAggrByIterator (iterator, sdaiAGGR, val);            ifcengine.sdaiPutAggrByIterator (iterator, ifcengine.sdaiAGGR, val);

sdaiADB                 int_t integerValue = 123;                                   int_t integerValue = 123;   
                        SdaiADB val = sdaiCreateADB (sdaiINTEGER, &integerValue);   int_t val = ifcengine.sdaiCreateADB (ifcengine.sdaiINTEGER, ref integerValue);
                        sdaiPutADBTypePath (val, 1, "IFCINTEGER");                  ifcengine.sdaiPutADBTypePath (val, 1, "IFCINTEGER");
                        sdaiPutAggrByIterator (iterator, sdaiADB, val);             ifcengine.sdaiPutAggrByIterator (iterator, ifcengine.sdaiADB, val); 
                        sdaiDeleteADB (val);                                        ifcengine.sdaiDeleteADB (val);
TCHAR is “char” or “wchar_t” depending on setStringUnicode. (Non-standard behavior) sdaiLOGICAL behaves differently from ISO 10303-24-2001: it expects char* while standard declares int_t. (Non-standard extension) sdiADB in C++ has an option to work without sdaiCreateEmptyADB and sdaiDeleteADB as shown in the table.
Table 2 - valueType can be requested depending on actual model data.

valueType       Works for following values in the model
                  integer      real     .T. or .F.     .U.      other enum    binary      string     instance      list      $ (empty)
sdaiINTEGER         Yes          .           .           .           .           .           .           .           .           .
sdaiREAL             .          Yes          .           .           .           .           .           .           .           .
sdaiNUMBER           .          Yes          .           .           .           .           .           .           .           .
sdaiBOOLEAN          .           .          Yes          .           .           .           .           .           .           .
sdaiLOGICAL          .           .          Yes         Yes          .           .           .           .           .           .
sdaiENUM             .           .          Yes         Yes         Yes          .           .           .           .           .
sdaiBINARY           .           .           .           .           .          Yes          .           .           .           .
sdaiSTRING           .           .           .           .           .           .          Yes          .           .           .
sdaiUNICODE          .           .           .           .           .           .          Yes          .           .           .
sdaiEXPRESSSTRING    .           .           .           .           .           .          Yes          .           .           .
sdaiINSTANCE         .           .           .           .           .           .           .          Yes          .           .
sdaiAGGR             .           .           .           .           .           .           .           .          Yes          .
sdaiADB             Yes         Yes         Yes         Yes         Yes         Yes         Yes         Yes         Yes          .

...

...

...

...

...