sdaiPutADBTypePath

...

Syntax

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

[DllImport(IFCEngineDLL, EntryPoint = "sdaiPutADBTypePath")]
public static extern void sdaiPutADBTypePath(Int32 ADB, Int32 pathCount, string path);

[DllImport(IFCEngineDLL, EntryPoint = "sdaiPutADBTypePath")]
public static extern void sdaiPutADBTypePath(Int32 ADB, Int32 pathCount, byte[] path);    

Property ADB

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

Property pathCount

Size: 32 bit / 4 byte (value)
The number of path's for this ADB type, in case of IFC4 and all earlier versions this should always be 1.

Property path

Size: 32 bit / 4 byte (reference)
The path of the ADB type, in case of example IFCLABEL('myLabel') the path is "IFCLABEL".

Examples

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

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

Int32 buildSIUnitInstance(Int32 model, string UnitType, string Prefix, string Name)
{
    //  #31313 = IFCSIUNIT(*, .PLANEANGLEUNIT., $, .RADIAN.);
    Int32 ifcSIUnitInstance = IfcEngine.x86.sdaiCreateInstanceBN(model, System.Text.Encoding.UTF8.GetBytes("IFCSIUNIT"));

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

    return ifcSIUnitInstance;
}

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

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

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

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

    return ifcMeasureWithUnitInstance;
}