SaveModelW

This function saves the current model on location fileName.

Syntax

public const string EngineDLL = @"engine.dll";[DllImport(EngineDLL, EntryPoint = "SaveModelW")]
public static extern Int64 SaveModelW(Int64 model, string fileName);

[DllImport(EngineDLL, EntryPoint = "SaveModelW")]
public static extern Int64 SaveModelW(Int64 model, byte[] fileName);    

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 fileName

Size: 32 bit / 4 byte (reference)
The file name of the file as available in the file system in ASCII (char *). The given char array will not be adjusted, on each OS the size of a char element is 8 bit / 1 byte.

Example

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

using Engine;

...

static void Main(string[] args)
{
    Int64   model = Engine.x86_64.CreateModel();

    if (model) {
        //
        //  Classes
        //
        Int64   classCone = Engine.x86_64.GetClassByName(model, "Cone");

        //
        //  Datatype Properties (attributes)
        //
        Int64   propertyHeight = Engine.x86_64.GetPropertyByName(model, "height"),
                propertyRadius = Engine.x86_64.GetPropertyByName(model, "radius"),
                propertySegmentationParts = Engine.x86_64.GetPropertyByName(model, "segmentationParts");

        //
        //  Instances
        //
        Int64   myInstanceCone = Engine.x86_64.CreateInstance(classCone, (string) null);

        double  height = 2.8,
                radius = 1.3;
        Int64   segmentationParts = 36;
        
        Engine.x86_64.SetDatatypeProperty(myInstanceCone, propertyHeight, ref height, 1);
        Engine.x86_64.SetDatatypeProperty(myInstanceCone, propertyRadius, ref radius, 1);
        Engine.x86_64.SetDatatypeProperty(myInstanceCone, propertySegmentationParts, ref segmentationParts, 1);

        //
        //  The resulting model can be viewed in 3D-Editor.exe
        //
        Engine.x86_64.SaveModelW(model, System.Text.Encoding.Unicode.GetBytes("c:\\created\\myFile.bin"));

        Engine.x86_64.CloseModel(model);
    }
}