SetSPFFHeaderItem

This call can be used to write a specific header item, the source code example is larger to show and explain how this call can be used.

Syntax

public const string ifcenginedll = @"ifcengine.dll";

[DllImport(IFCEngineDLL, EntryPoint = "SetSPFFHeaderItem")]
public static extern Int64 SetSPFFHeaderItem(int_t model, int_t itemIndex, int_t itemSubIndex, int_t valueType, out IntPtr value);    

Property model

Size: 64 bit / 8 byte (value)
The handle to the model. The model handle is static during its existance. Several models can be opened simultaniously within one session. Different models are always independent, threads are allowed to be running on different models simultaniously.

Property itemIndex

Size: 64 bit / 8 byte (value)
...

Property itemSubIndex

Size: 64 bit / 8 byte (value)
...

Property valueType

Size: 64 bit / 8 byte (value)
...

Property value

Size: 64 bit / 8 byte (reference)
...

Example (based on pure API calls)

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

using RDF;      //  include at least engine.cs within your solution

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