sdaiSaveModelAsSimpleXmlBNUnicode

This call can be used to save a model in simple XML Format, this XML serialization is advised for ifcXML files of schema IFC4 and later. The file name can be any unicode filename with a character length of 16 bits.

Syntax

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

[DllImport(IFCEngineDLL, EntryPoint = "sdaiSaveModelAsSimpleXmlBNUnicode")]
public static extern void sdaiSaveModelAsSimpleXmlBNUnicode(Int32 model, byte[] fileName);    

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 fileName

Size: 32 bit / 4 byte (reference)
Address of string containing the path of the IFC file, for example 'C:\myPath\myFile.ifc' or 'C:\myPath\myFile.ifcXML'.

Examples

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

string ifcFileName = "myFile 友𠂇又.ifc";

//
//  The schema file is expected to be IFC4.exp as this XML format is typically used for IFC4
//
Int32 model = IfcEngine.x86.sdaiOpenModelBNUnicode(0, System.Text.Encoding.Unicode.GetBytes(ifcFileName), System.Text.Encoding.Unicode.GetBytes("IFC4.exp"));

if (model != 0)
{
    ...         //  Use the open model to read/write/edit the content
    ...         //  or to create geometry

    string ifcFileNameSaving = "mySavedFile 友𠂇又.ifc";            //  The file name is expected to end at .ifx or .ifcXML, this is of course totally free from technical Point-Of-View
    ...

    IfcEngine.x86.sdaiSaveModelAsSimpleXmlBNUnicode(model, System.Text.Encoding.Unicode.GetBytes(ifcFileNameSaving));

    IfcEngine.x86.sdaiCloseModel(model);
    model = 0;  //  Not required of course
}