sdaiPutAttrBN

...

Syntax

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

[DllImport(IFCEngineDLL, EntryPoint = "sdaiPutAttrBN")]
public static extern void sdaiPutAttrBN(Int32 instance, string attributeName, Int32 valueType, ref  Int32 value);

[DllImport(IFCEngineDLL, EntryPoint = "sdaiPutAttrBN")]
public static extern void sdaiPutAttrBN(Int32 instance, string attributeName, Int32 valueType, ref double value);

[DllImport(IFCEngineDLL, EntryPoint = "sdaiPutAttrBN")]
public static extern void sdaiPutAttrBN(Int32 instance, string attributeName, Int32 valueType, string value);

[DllImport(IFCEngineDLL, EntryPoint = "sdaiPutAttrBN")]
public static extern void sdaiPutAttrBN(Int32 instance, string attributeName, Int32 valueType, byte[] value);

[DllImport(IFCEngineDLL, EntryPoint = "sdaiPutAttrBN")]
public static extern void sdaiPutAttrBN(Int32 instance, byte[] attributeName, Int32 valueType, ref  Int32 value);

[DllImport(IFCEngineDLL, EntryPoint = "sdaiPutAttrBN")]
public static extern void sdaiPutAttrBN(Int32 instance, byte[] attributeName, Int32 valueType, ref double value);

[DllImport(IFCEngineDLL, EntryPoint = "sdaiPutAttrBN")]
public static extern void sdaiPutAttrBN(Int32 instance, byte[] attributeName, Int32 valueType, string value);

[DllImport(IFCEngineDLL, EntryPoint = "sdaiPutAttrBN")]
public static extern void sdaiPutAttrBN(Int32 instance, byte[] attributeName, Int32 valueType, byte[] value);    

Property instance

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

Property attributeName

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

Property valueType

Size: 32 bit / 4 byte (value)
Type of the value, for example sdaiSTRING, sdaiINSTANCE, sdaiREAL, ...

Property value

Size: 32 bit / 4 byte (reference)
Placeholder for the information, formatting depending on defined valueType.

Examples

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

//
//  Created result when stored as IFC:
//  #31313 = IFCPOSTALADDRESS($, $, $, $, ('RDF Ltd.', 'Main Office'), '32', 'Bankya', 'Sofia', '1320', 'Bulgaria');
//
Int32 ifcPostalAddressInstance = IfcEngine.x86.sdaiCreateInstanceBN(model, System.Text.Encoding.UTF8.GetBytes("IFCPOSTALADDRESS"));

Int32 addressLines = IfcEngine.x86.sdaiCreateAggrBN(ifcPostalAddressInstance, System.Text.Encoding.UTF8.GetBytes("AddressLines"));
IfcEngine.x86.sdaiAppend(addressLines, IfcEngine.x86.sdaiSTRING, System.Text.Encoding.UTF8.GetBytes("RDF Ltd."));
IfcEngine.x86.sdaiAppend(addressLines, IfcEngine.x86.sdaiSTRING, System.Text.Encoding.UTF8.GetBytes("Main Office"));

IfcEngine.x86.sdaiPutAttrBN(ifcPostalAddressInstance, System.Text.Encoding.UTF8.GetBytes("PostalBox"), IfcEngine.x86.sdaiSTRING, System.Text.Encoding.UTF8.GetBytes("32"));
IfcEngine.x86.sdaiPutAttrBN(ifcPostalAddressInstance, System.Text.Encoding.UTF8.GetBytes("Town"), IfcEngine.x86.sdaiSTRING, System.Text.Encoding.UTF8.GetBytes("Bankya"));
IfcEngine.x86.sdaiPutAttrBN(ifcPostalAddressInstance, System.Text.Encoding.UTF8.GetBytes("Region"), IfcEngine.x86.sdaiSTRING, System.Text.Encoding.UTF8.GetBytes("Sofia"));         //  It is allowed to mix sdaiUNICODE and sdaiSTRING
IfcEngine.x86.sdaiPutAttrBN(ifcPostalAddressInstance, System.Text.Encoding.UTF8.GetBytes("PostalCode"), IfcEngine.x86.sdaiUNICODE, System.Text.Encoding.Unicode.GetBytes("1320"));  //  as long as each call is consitent in itself.
IfcEngine.x86.sdaiPutAttrBN(ifcPostalAddressInstance, System.Text.Encoding.UTF8.GetBytes("Country"), IfcEngine.x86.sdaiSTRING, System.Text.Encoding.UTF8.GetBytes("Bulgaria"));