sdaiPutADBTypePath

...

Syntax

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

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

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

Property ADB

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

Property pathCount

Size: 64 bit / 8 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: 64 bit / 8 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.);
//

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;
}