sdaiGetAggrByIndex
Table 1 – Required value buffer depending on valueType (on the example of sdaiGetAggrByIndex but valid for all get-functions)
valueType C/C++ C#
sdaiINTEGER int_t val; int_t val;
sdaiGetAggrByIndex (aggregate, index, sdaiINTEGER, &val); ifcengine.sdaiGetAggrByIndex (aggregate, index, ifcengine.sdaiINTEGER, out val);
sdaiREAL or sdaiNUMBER double val; double val;
sdaiGetAggrByIndex (aggregate, index, sdaiREAL, &val); ifcengine.sdaiGetAggrByIndex (aggregate, index, ifcengine.sdaiREAL, out val);
sdaiBOOLEAN SdaiBoolean val; bool val;
sdaiGetAggrByIndex (aggregate, index, sdaiBOOLEAN, &val); ifcengine.sdaiGetAggrByIndex (aggregate, index, ifcengine.sdaiBOOLEAN, out val);
sdaiLOGICAL const TCHAR* val; string val;
sdaiGetAggrByIndex (aggregate, index, sdaiLOGICAL, &val); ifcengine.sdaiGetAggrByIndex (aggregate, index, ifcengine.sdaiLOGICAL, out val);
sdaiENUM const TCHAR* val; string val;
sdaiGetAggrByIndex (aggregate, index, sdaiENUM, &val); ifcengine.sdaiGetAggrByIndex (aggregate, index, ifcengine.sdaiENUM, out val);
sdaiBINARY const TCHAR* val; string val;
sdaiGetAggrByIndex (aggregate, index, sdaiBINARY, &val); ifcengine.sdaiGetAggrByIndex (aggregate, index, ifcengine.sdaiBINARY, out val);
sdaiSTRING const char* val; string val;
sdaiGetAggrByIndex (aggregate, index, sdaiSTRING, &val); ifcengine.sdaiGetAggrByIndex (aggregate, index, ifcengine.sdaiSTRING, out val);
sdaiUNICODE const wchar_t* val; string val;
sdaiGetAggrByIndex (aggregate, index, sdaiUNICODE, &val); ifcengine.sdaiGetAggrByIndex (aggregate, index, ifcengine.sdaiUNICODE, out val);
sdaiEXPRESSSTRING const char* val; string val;
sdaiGetAggrByIndex (aggregate, index, sdaiEXPRESSSTRING, &val); ifcengine.sdaiGetAggrByIndex (aggregate, index, ifcengine.sdaiEXPRESSSTRING, out val);
sdaiINSTANCE SdaiInstance val; int_t val;
sdaiGetAggrByIndex (aggregate, index, sdaiINSTANCE, &val); ifcengine.sdaiGetAggrByIndex (aggregate, index, ifcengine.sdaiINSTANCE, out val);
sdaiAGGR SdaiAggr aggr; int_t aggr;
sdaiGetAggrByIndex (aggregate, index, sdaiAGGR, &aggr); ifcengine.sdaiGetAggrByIndex (aggregate, index, ifcengine.sdaiAGGR, out aggr);
sdaiADB SdaiADB adb = sdaiCreateEmptyADB(); int_t adb = 0; // it is important to initialize
sdaiGetAggrByIndex (aggregate, index, sdaiADB, adb); ifcengine.sdaiGetAggrByIndex (aggregate, index, ifcengine.sdaiADB, out adb);
sdaiDeleteADB (adb);
SdaiADB adb = nullptr; // it is important to initialize
sdaiGetAggrByIndex (aggregate, index, 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.
Syntax
// // Strong typing definition // void * sdaiGetAggrByIndex( const SdaiAggr aggregate, SdaiAggrIndex index, SdaiPrimitiveType valueType, void * value ); static inline SdaiInstance sdaiGetAggrByIndex( const SdaiAggr aggregate, SdaiAggrIndex index, SdaiInstance * sdaiInstance ) { return (SdaiInstance) sdaiGetAggrByIndex( aggregate, index, sdaiINSTANCE, // valueType (void*) sdaiInstance // value ); } static inline SdaiInstance sdaiGetAggrByIndex( const SdaiAggr aggregate, SdaiAggrIndex index ) { SdaiInstance sdaiInstance = 0; return sdaiGetAggrByIndex( aggregate, index, &sdaiInstance // value ); } // // Weak typing definition // void __declspec(dllexport) * __stdcall sdaiGetAggrByIndex( const int_t * aggregate, int_t index, int_t valueType, void * value ); static inline void sdaiGetAggrByIndex( const int_t * aggregate, int_t index, int_t * sdaiInstance ) { return (SdaiInstance) sdaiGetAggrByIndex( aggregate, index, sdaiINSTANCE, // valueType (void*) sdaiInstance // value ); } static inline void sdaiGetAggrByIndex( const int_t * aggregate, int_t index ) { SdaiInstance sdaiInstance = 0; return sdaiGetAggrByIndex( aggregate, index, &sdaiInstance // value ); }