sdaiGetADBType

...

Syntax

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

[DllImport(IFCEngineDLL, EntryPoint = "sdaiGetADBType")]
public static extern Int64 sdaiGetADBType(Int64 ADB);    

Property ADB

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

Examples

Here you can find code snippits that show how the API call sdaiGetADBType 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'),$);
    //
    IntPtr namePtr = IntPtr.Zero,
           descriptionPtr = IntPtr.Zero,
           nominalValuePtr = IntPtr.Zero,
           typePathPtr = IntPtr.Zero,
           unitPtr = IntPtr.Zero;
    Int64 nominalValueADB = 0;

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

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

        ...

        default:
            break;
    }

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