sdaiGetAttrBN

...

Syntax

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

[DllImport(IFCEngineDLL, EntryPoint = "sdaiGetAttrBN")]
public static extern Int64 sdaiGetAttrBN(Int64 instance, string attributeName, Int64 valueType, out  Int64 value);

[DllImport(IFCEngineDLL, EntryPoint = "sdaiGetAttrBN")]
public static extern Int64 sdaiGetAttrBN(Int64 instance, string attributeName, Int64 valueType, out double value);

[DllImport(IFCEngineDLL, EntryPoint = "sdaiGetAttrBN")]
public static extern Int64 sdaiGetAttrBN(Int64 instance, string attributeName, Int64 valueType, out IntPtr value);

[DllImport(IFCEngineDLL, EntryPoint = "sdaiGetAttrBN")]
public static extern Int64 sdaiGetAttrBN(Int64 instance, byte[] attributeName, Int64 valueType, out  Int64 value);

[DllImport(IFCEngineDLL, EntryPoint = "sdaiGetAttrBN")]
public static extern Int64 sdaiGetAttrBN(Int64 instance, byte[] attributeName, Int64 valueType, out double value);

[DllImport(IFCEngineDLL, EntryPoint = "sdaiGetAttrBN")]
public static extern Int64 sdaiGetAttrBN(Int64 instance, byte[] attributeName, Int64 valueType, out IntPtr value);    

Property instance

Size: 64 bit / 8 byte (value)
Handle of an instance within an IFC file, for example #31313 = IFCWALLSTANDARDCASE(...)

Property attributeName

Size: 64 bit / 8 byte (reference)
Name of the attribute, for example Name of IFCROOT as defined in IFC4.exp.

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 sdaiGetAttrBN can be used.

void GetColumns(Int64 model)
{
    Int64 ifcColumnInstances = IfcEngine.x64.sdaiGetEntityExtentBN(model, System.Text.Encoding.UTF8.GetBytes("IFCCOLUMN")),
          noIfcColumnInstances = IfcEngine.x64.sdaiGetMemberCount(ifcColumnInstances);
    if (noIfcColumnInstances != 0)
    {
        for (Int64 i = 0; i < noIfcColumnInstances; i++)
        {
            Int64 ifcColumnInstance = 0;
            IfcEngine.x64.engiGetAggrElement(ifcColumnInstances, i, IfcEngine.x64.sdaiINSTANCE, out ifcColumnInstance);

            IntPtr globalIdPtr = IntPtr.Zero;
            IfcEngine.x64.sdaiGetAttrBN(ifcColumnInstance, System.Text.Encoding.UTF8.GetBytes("GlobalId"), IfcEngine.x64.sdaiUNICODE, out globalIdPtr);
            string globalId = Marshal.PtrToStringUni(globalIdPtr);

            IntPtr namePtr = IntPtr.Zero;
            IfcEngine.x64.sdaiGetAttrBN(ifcColumnInstance, System.Text.Encoding.UTF8.GetBytes("Name"), IfcEngine.x64.sdaiUNICODE, out namePtr);
            string name = Marshal.PtrToStringUni(namePtr);

            IntPtr descriptionPtr = IntPtr.Zero;
            IfcEngine.x64.sdaiGetAttrBN(ifcColumnInstance, System.Text.Encoding.UTF8.GetBytes("Description"), IfcEngine.x64.sdaiUNICODE, out descriptionPtr);
            string description = Marshal.PtrToStringUni(descriptionPtr);
        }
    }
}