sdaiCreateADB

...

Syntax

//   Visual Studio for Windows
public:
void __declspec(dllexport) * __stdcall sdaiCreateADB(
            __int64 valueType,
            void    * value
        );

//   Linux, OS-X and non-Visual Studio Windows solutions
public:
void * sdaiCreateADB(
            int64_t valueType,
            void    * value
        );    

Property valueType

Size: 64 bit / 8 byte (value)
Type of the value, for example sdaiSTRING, sdaiINSTANCE, sdaiREAL, ...

Property value

Size: 64 bit / 8 byte (reference)
Placeholder for the information, formatting depending on defined valueType.

Examples

Here you can find code snippits that show how the API call sdaiCreateADB can be used.

//
//  #13131 = IFCMEASUREWITHUNIT(IFCPLANEANGLEMEASURE(1.745E-2), #31313);
//  #31313 = IFCSIUNIT(*, .PLANEANGLEUNIT., $, .RADIAN.);
//

__int64 buildSIUnitInstance(__int64 model, char * UnitType, char * Prefix, char * Name)
{
    //  #31313 = IFCSIUNIT(*, .PLANEANGLEUNIT., $, .RADIAN.);
    __int64 ifcSIUnitInstance = sdaiCreateInstanceBN(model, "IFCSIUNIT");

    sdaiPutAttrBN(ifcSIUnitInstance, "UnitType", sdaiENUM, UnitType);
    if  (Prefix) {
        sdaiPutAttrBN(ifcSIUnitInstance, "Prefix", sdaiENUM, Prefix);
    }
    sdaiPutAttrBN(ifcSIUnitInstance, "Name", sdaiENUM, Name);

    return  ifcSIUnitInstance;
}

__int64	buildMeasureWithUnitInstance(__int64 model)
{
    void    * valueComponentADB;
    double  valueComponent= 0.01745;

    //  #13131 = IFCMEASUREWITHUNIT(IFCPLANEANGLEMEASURE(1.745E-2), #31313);
    __int64 ifcMeasureWithUnitInstance = sdaiCreateInstanceBN(model, "IFCMEASUREWITHUNIT");

    valueComponentADB = sdaiCreateADB(sdaiREAL, &valueComponent);
    sdaiPutADBTypePath(valueComponentADB, 1, "IFCPLANEANGLEMEASURE"); 
    sdaiPutAttrBN(ifcMeasureWithUnitInstance, "ValueComponent", sdaiADB, (void*) valueComponentADB);

    sdaiPutAttrBN(ifcMeasureWithUnitInstance, "UnitComponent", sdaiINSTANCE, (void*) buildSIUnitInstance(model, "PLANEANGLEUNIT", 0, "RADIAN"));

    return  ifcMeasureWithUnitInstance;
}