GetSPFFHeaderItem

...

Syntax

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

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

Property model

Size: 64 bit / 8 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: 64 bit / 8 byte (value)
Integer value equal or larger then 0 giving the header element index where this value is placed.

Property itemSubIndex

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

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

//...

using System.Runtime.InteropServices;   //  To support Marshal

namespace abc
{
    public class myClass
    {
        void GetHeaderDescription(Int64 model)
        {
            Int64 i = 0;
            IntPtr textPtr = IntPtr.Zero;
            if (IfcEngine.x64.GetSPFFHeaderItem(model, 0, i, IfcEngine.x64.sdaiUNICODE, out textPtr) != 0)
            {
                while (IfcEngine.x64.GetSPFFHeaderItem(model, 0, i++, IfcEngine.x64.sdaiUNICODE, out textPtr) != 0)
                {
                    string text = Marshal.PtrToStringUni(textPtr);
                }
            }
        }

        void GetImplementationLevel(Int64 model)
        {
            Int64 i = 0;
            IntPtr textPtr = IntPtr.Zero;
            IfcEngine.x64.GetSPFFHeaderItem(model, 1, 0, IfcEngine.x64.sdaiUNICODE, out textPtr);
            string text = Marshal.PtrToStringUni(textPtr);
        }

        void GetName(Int64 model)
        {
            Int64 i = 0;
            IntPtr textPtr = IntPtr.Zero;
            IfcEngine.x64.GetSPFFHeaderItem(model, 2, 0, IfcEngine.x64.sdaiUNICODE, out textPtr);
            string text = Marshal.PtrToStringUni(textPtr);
        }

        void GetTimeStamp(Int64 model)
        {
            Int64 i = 0;
            IntPtr textPtr = IntPtr.Zero;
            IfcEngine.x64.GetSPFFHeaderItem(model, 3, 0, IfcEngine.x64.sdaiUNICODE, out textPtr);
            string text = Marshal.PtrToStringUni(textPtr);
        }

        void GetAuthor(Int64 model)
        {
            Int64 i = 0;
            IntPtr textPtr = IntPtr.Zero;
            if (IfcEngine.x64.GetSPFFHeaderItem(model, 4, i, IfcEngine.x64.sdaiUNICODE, out textPtr) != 0)
            {
                while (IfcEngine.x64.GetSPFFHeaderItem(model, 4, i++, IfcEngine.x64.sdaiUNICODE, out textPtr) != 0)
                {
                    string text = Marshal.PtrToStringUni(textPtr);
                }
            }
        }

        void GetOrganization(Int64 model)
        {
            Int64 i = 0;
            IntPtr textPtr = IntPtr.Zero;
            if (IfcEngine.x64.GetSPFFHeaderItem(model, 5, i, IfcEngine.x64.sdaiUNICODE, out textPtr) != 0)
            {
                while (IfcEngine.x64.GetSPFFHeaderItem(model, 5, i++, IfcEngine.x64.sdaiUNICODE, out textPtr) != 0)
                {
                    string text = Marshal.PtrToStringUni(textPtr);
                }
            }
        }

        void GetPreprocessorVersion(Int64 model)
        {
            Int64 i = 0;
            IntPtr textPtr = IntPtr.Zero;
            IfcEngine.x64.GetSPFFHeaderItem(model, 6, 0, IfcEngine.x64.sdaiUNICODE, out textPtr);
            string text = Marshal.PtrToStringUni(textPtr);
        }

        void GetOriginatingSystem(Int64 model)
        {
            Int64 i = 0;
            IntPtr textPtr = IntPtr.Zero;
            IfcEngine.x64.GetSPFFHeaderItem(model, 7, 0, IfcEngine.x64.sdaiUNICODE, out textPtr);
            string text = Marshal.PtrToStringUni(textPtr);
        }

        void GetAuthorization(Int64 model)
        {
            Int64 i = 0;
            IntPtr textPtr = IntPtr.Zero;
            IfcEngine.x64.GetSPFFHeaderItem(model, 8, 0, IfcEngine.x64.sdaiUNICODE, out textPtr);
            string text = Marshal.PtrToStringUni(textPtr);
        }

        void GetFileSchema(Int64 model)
        {
            Int64 i = 0;
            IntPtr textPtr = IntPtr.Zero;
            if (IfcEngine.x64.GetSPFFHeaderItem(model, 9, i, IfcEngine.x64.sdaiUNICODE, out textPtr) != 0)
            {
                while (IfcEngine.x64.GetSPFFHeaderItem(model, 9, i++, IfcEngine.x64.sdaiUNICODE, out textPtr) != 0)
                {
                    string text = Marshal.PtrToStringUni(textPtr);
                }
            }
        }

        ...