sdaiGetADBValue

...

Syntax

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

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

Property ADB

Size: 64 bit / 8 byte (value)
Handle to ADB type, a typical representation is IFCLABEL('myLabel') or IFCINTEGER(313).

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 sdaiGetADBValue can be used.

//
//  ENTITY IfcProperty;
//      Name                     : IfcIdentifier;
//      Description              : OPTIONAL IfcText;
//    INVERSE
//      PropertyForDependance    : SET OF IfcPropertyDependencyRelationship FOR DependingProperty;
//      PropertyDependsOn        : SET OF IfcPropertyDependencyRelationship FOR DependantProperty;
//      PartOfComplex            : SET [0:1] OF IfcComplexProperty FOR HasProperties;
//  ENTITY IfcSimpleProperty;
//  ENTITY IfcPropertySingleValue;
//      NominalValue             : OPTIONAL IfcValue;
//      Unit                     : OPTIONAL IfcUnit;
//
void    GetIfcPropertySingleValue(__int64 model, __int64 ifcPropertySingleValue)
{
    //
    //  for example:
    //    #31313 = IFCPROPERTYSINGLEVALUE('Category',$,IFCLABEL('Rooms'),$);
    //
    char    * name = 0,
            * description = 0,
            * nominalValue = 0,
            * typePath = 0,
            * unit = 0;
    __int64 * nominalValueADB = 0;

    sdaiGetAttrBN(ifcPropertySingleValue, "Name", sdaiSTRING, &name);                   //  name = 'Category'
    sdaiGetAttrBN(ifcPropertySingleValue, "Description", sdaiSTRING, &description);     //  description = 0

    sdaiGetAttrBN(ifcPropertySingleValue, "NominalValue", sdaiADB, &nominalValueADB);
    typePath = sdaiGetADBTypePath(nominalValueADB, 0);                                  //  typePath = 'IFCLABEL'
    switch  (sdaiGetADBType(nominalValueADB)) {
        case  sdaiSTRING:
            sdaiGetADBValue(nominalValueADB, sdaiSTRING, (void *) &nominalValue);       //  nominalValue = 'Rooms'
            break;

        ...

        default:
            break;
    }

    sdaiGetAttrBN(ifcPropertySingleValue, "Unit", sdaiSTRING, &unit);                   //  unit = 0
}