SetSPFFHeaderItem

...

Syntax

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

[DllImport(IFCEngineDLL, EntryPoint = "SetSPFFHeaderItem")]
public static extern Int32 SetSPFFHeaderItem(Int32 model, Int32 itemIndex, Int32 itemSubIndex, Int32 valueType, string value);

[DllImport(IFCEngineDLL, EntryPoint = "SetSPFFHeaderItem")]
public static extern Int32 SetSPFFHeaderItem(Int32 model, Int32 itemIndex, Int32 itemSubIndex, Int32 valueType, byte[] value);    

Property model

Size: 32 bit / 4 byte (value)
Handle of the model containing the IFC file, this handle is needed in many other calls and given when the model is created.

Property itemIndex

Size: 32 bit / 4 byte (value)
Integer value equal or larger then 0 giving the header element index where this value is placed.

Property itemSubIndex

Size: 32 bit / 4 byte (value)
Integer value equal or larger then 0 giving the header sub element index where this value is placed.

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

string ifcFileName = "myFileName", timeStamp = "current date and time";

...
...

//  set Description
IfcEngine.x86.SetSPFFHeaderItem(model, 0, 0, IfcEngine.x86.sdaiUNICODE, System.Text.Encoding.Unicode.GetBytes("ViewDefinition [CoordinationView]"));
IfcEngine.x86.SetSPFFHeaderItem(model, 0, 1, IfcEngine.x86.sdaiSTRING, null);
//  set Implementation Level
IfcEngine.x86.SetSPFFHeaderItem(model, 1, 0, IfcEngine.x86.sdaiSTRING, System.Text.Encoding.UTF8.GetBytes("2;1"));
//  set Name
IfcEngine.x86.SetSPFFHeaderItem(model, 2, 0, IfcEngine.x86.sdaiUNICODE, System.Text.Encoding.Unicode.GetBytes(ifcFileName));
//  set Time Stamp
IfcEngine.x86.SetSPFFHeaderItem(model, 3, 0, IfcEngine.x86.sdaiUNICODE, System.Text.Encoding.Unicode.GetBytes(timeStamp));
//  set	Author
IfcEngine.x86.SetSPFFHeaderItem(model, 4, 0, IfcEngine.x86.sdaiUNICODE, System.Text.Encoding.UTF8.GetBytes("Architect"));  //  It is allowed to mix sdaiUNICODE and sdaiSTRING
IfcEngine.x86.SetSPFFHeaderItem(model, 4, 1, IfcEngine.x86.sdaiSTRING, null);                                              //  as long as each call is consitent in itself.
//  set Organization
IfcEngine.x86.SetSPFFHeaderItem(model, 5, 0, IfcEngine.x86.sdaiSTRING, System.Text.Encoding.UTF8.GetBytes("Building Designer Office"));
//  set Preprocessor Version
IfcEngine.x86.SetSPFFHeaderItem(model, 6, 0, IfcEngine.x86.sdaiSTRING, System.Text.Encoding.UTF8.GetBytes("IFC Engine DLL"));
//  set Originating System
IfcEngine.x86.SetSPFFHeaderItem(model, 7, 0, IfcEngine.x86.sdaiSTRING, System.Text.Encoding.UTF8.GetBytes("Documentation Example"));
//  set Authorization
IfcEngine.x86.SetSPFFHeaderItem(model, 8, 0, IfcEngine.x86.sdaiSTRING, System.Text.Encoding.UTF8.GetBytes("The authorising person"));
//  set File Schema
IfcEngine.x86.SetSPFFHeaderItem(model, 9, 0, IfcEngine.x86.sdaiSTRING, System.Text.Encoding.UTF8.GetBytes("IFC4"));
IfcEngine.x86.SetSPFFHeaderItem(model, 9, 1, IfcEngine.x86.sdaiSTRING, null);