sdaiCreateModelBN

This call can be used to create an empty model. Every model needs to be opened against a schema, the schema needs to be existing. The file name can be any ASCII filename with a character length of 8 bits.

Syntax

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

[DllImport(IFCEngineDLL, EntryPoint = "sdaiCreateModelBN")]
public static extern Int64 sdaiCreateModelBN(Int64 repository, string fileName, string schemaName);

[DllImport(IFCEngineDLL, EntryPoint = "sdaiCreateModelBN")]
public static extern Int64 sdaiCreateModelBN(Int64 repository, byte[] fileName, byte[] schemaName);    

Property repository

Size: 64 bit / 8 byte (value)
Not relevant within the IFC Engine DLL, although several models can be loaded at once, they will always be in separate models.

Property fileName

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

Property schemaName

Size: 64 bit / 8 byte (reference)
Address of string containing the path of the IFC schema, for example 'C:\myPath\IFC4.exp'.

Examples

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

//
//  In case input strings are already UTF8, the following line 
//
Int64 model = IfcEngine.x64.sdaiCreateModelBN(0, "", "IFC2X3_TC1.exp");

//
//  In case it is not sure each element with the string is UTF8, the following line is save
//    (will convert some of the characters, use of sdaiCreateModelBNUnicode is prefered)
//
Int64 model = IfcEngine.x64.sdaiCreateModelBN(0, null, System.Text.Encoding.UTF8.GetBytes("IFC2X3_TC1.exp"));

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

    string ifcFileNameSaving = "mySavedFile.ifc";

    //
    //  In case input strings are already UTF8, the following line
    //
    IfcEngine.x64.sdaiSaveModelBN(model, ifcFileNameSaving);

    //
    //  In case it is not sure each element with the string is UTF8, the following line is save
    //    (will convert some of the characters, use of sdaiSaveModelBNUnicode is prefered)
    //
    IfcEngine.x64.sdaiSaveModelBN(model, System.Text.Encoding.UTF8.GetBytes(ifcFileNameSaving));

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