sdaiCreateADB

...

Syntax

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

[DllImport(IFCEngineDLL, EntryPoint = "sdaiCreateADB")]
public static extern Int64 sdaiCreateADB(Int64 valueType, ref  Int64 value);

[DllImport(IFCEngineDLL, EntryPoint = "sdaiCreateADB")]
public static extern Int64 sdaiCreateADB(Int64 valueType, ref double value);

[DllImport(IFCEngineDLL, EntryPoint = "sdaiCreateADB")]
public static extern Int64 sdaiCreateADB(Int64 valueType, string value);

[DllImport(IFCEngineDLL, EntryPoint = "sdaiCreateADB")]
public static extern Int64 sdaiCreateADB(Int64 valueType, byte[] 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, string UnitType, string Prefix, string Name)
{
    //  #31313 = IFCSIUNIT(*, .PLANEANGLEUNIT., $, .RADIAN.);
    Int64 ifcSIUnitInstance = IfcEngine.x64.sdaiCreateInstanceBN(model, System.Text.Encoding.UTF8.GetBytes("IFCSIUNIT"));

    IfcEngine.x64.sdaiPutAttrBN(ifcSIUnitInstance, System.Text.Encoding.UTF8.GetBytes("UnitType"), IfcEngine.x64.sdaiENUM, System.Text.Encoding.UTF8.GetBytes(UnitType));
    if (Prefix != null)
    {
        IfcEngine.x64.sdaiPutAttrBN(ifcSIUnitInstance, System.Text.Encoding.UTF8.GetBytes("Prefix"), IfcEngine.x64.sdaiENUM, System.Text.Encoding.UTF8.GetBytes(Prefix));
    }
    IfcEngine.x64.sdaiPutAttrBN(ifcSIUnitInstance, System.Text.Encoding.UTF8.GetBytes("Name"), IfcEngine.x64.sdaiENUM, System.Text.Encoding.UTF8.GetBytes(Name));

    return ifcSIUnitInstance;
}

Int64 buildMeasureWithUnitInstance(Int64 model)
{
    Int64 valueComponentADB;
    double valueComponent = 0.01745;

    //  #13131 = IFCMEASUREWITHUNIT(IFCPLANEANGLEMEASURE(1.745E-2), #31313);
    Int64 ifcMeasureWithUnitInstance = IfcEngine.x64.sdaiCreateInstanceBN(model, System.Text.Encoding.UTF8.GetBytes("IFCMEASUREWITHUNIT"));

    valueComponentADB = IfcEngine.x64.sdaiCreateADB(IfcEngine.x64.sdaiREAL, ref valueComponent);
    IfcEngine.x64.sdaiPutADBTypePath(valueComponentADB, 1, System.Text.Encoding.UTF8.GetBytes("IFCPLANEANGLEMEASURE"));
    IfcEngine.x64.sdaiPutAttrBN(ifcMeasureWithUnitInstance, System.Text.Encoding.UTF8.GetBytes("ValueComponent"), IfcEngine.x64.sdaiADB, ref valueComponentADB);

    IfcEngine.x64.sdaiPutAttrBN(ifcMeasureWithUnitInstance, System.Text.Encoding.UTF8.GetBytes("UnitComponent"), IfcEngine.x64.sdaiINSTANCE, ref buildSIUnitInstance(model, "PLANEANGLEUNIT", null, "RADIAN"));

    return ifcMeasureWithUnitInstance;
}