sdaiGetADBValue

...

Syntax

public const string IFCEngineDLL = @"IFCEngine.dll";

[DllImport(IFCEngineDLL, EntryPoint = "sdaiGetADBValue")]
public static extern void sdaiGetADBValue(Int32 ADB, Int32 valueType, out  Int32 value);

[DllImport(IFCEngineDLL, EntryPoint = "sdaiGetADBValue")]
public static extern void sdaiGetADBValue(Int32 ADB, Int32 valueType, out double value);

[DllImport(IFCEngineDLL, EntryPoint = "sdaiGetADBValue")]
public static extern void sdaiGetADBValue(Int32 ADB, Int32 valueType, out IntPtr value);    

Property ADB

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

Property valueType

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

Property value

Size: 32 bit / 4 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(Int32 model, Int32 ifcPropertySingleValue)
{
    //
    //  for example:
    //    #31313 = IFCPROPERTYSINGLEVALUE('Category',$,IFCLABEL('Rooms'),$);
    //
    IntPtr namePtr = IntPtr.Zero,
           descriptionPtr = IntPtr.Zero,
           nominalValuePtr = IntPtr.Zero,
           typePathPtr = IntPtr.Zero,
           unitPtr = IntPtr.Zero;
    Int32 nominalValueADB = 0;

    IfcEngine.x86.sdaiGetAttrBN(ifcPropertySingleValue, System.Text.Encoding.UTF8.GetBytes("Name"), IfcEngine.x86.sdaiUNICODE, out namePtr);                   //  name = 'Category'
    IfcEngine.x86.sdaiGetAttrBN(ifcPropertySingleValue, System.Text.Encoding.UTF8.GetBytes("Description"), IfcEngine.x86.sdaiUNICODE, out descriptionPtr);     //  description = 0

    IfcEngine.x86.sdaiGetAttrBN(ifcPropertySingleValue, System.Text.Encoding.UTF8.GetBytes("NominalValue"), IfcEngine.x86.sdaiADB, out nominalValueADB);
    IfcEngine.x86.sdaiGetADBTypePath(nominalValueADB, 0, out typePathPtr);                                  //  typePath = 'IFCLABEL'
    string typePath = Marshal.PtrToStringAnsi(typePathPtr);
    switch  (IfcEngine.x86.sdaiGetADBType(nominalValueADB)) {
        case  IfcEngine.x86.sdaiSTRING:
            IfcEngine.x86.sdaiGetADBValue(nominalValueADB, IfcEngine.x86.sdaiUNICODE, out nominalValuePtr);
            string nominalValue = Marshal.PtrToStringUni(nominalValuePtr);                                  //  nominalValue = 'Rooms'
            break;

        ...

        default:
            break;
    }

    IfcEngine.x86.sdaiGetAttrBN(ifcPropertySingleValue, System.Text.Encoding.UTF8.GetBytes("Unit"), IfcEngine.x86.sdaiUNICODE, out unitPtr);                   //  unit = 0
}