GetInstanceClassEx

Syntax

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

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 owlInstance

Size: 64 bit / 8 byte (value)
The handle to the specific instance in the design tree. The instance handle is static within one open model but is most probably different when the same instance is opened in another model. The instance is always exactly of one unique class.

Example

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

using Engine;

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

    if (model != 0)
    {
        //
        //  The following setting makes sure all class handled are in an ordered list
        //  In certain cases where several models are open or in case of conversion
        //  between formats this can be handy and / or time efficient.
        //
        Engine.x86_64.OrderedHandles(model, (IntPtr) null, (IntPtr) null, (IntPtr) null, 1 + 2 + 4, 1 + 2 + 4);

        //
        //  Classes
        //
        Int64   classAbcd = Engine.x86_64.CreateClass(model, "ABCD"),
                classCube = Engine.x86_64.CreateClass(model, "Cube"),
                classMatrix = Engine.x86_64.CreateClass(model, "Matrix");

        //
        //  Instances
        //
        Int64   instanceAbcd = Engine.x86_64.CreateInstanceEx(model, classAbcd, (string) null),
                instanceCube = Engine.x86_64.CreateInstanceEx(model, classCube, (string) null),
                instanceMatrixI = Engine.x86_64.CreateInstanceEx(model, classMatrix, (string) null),
                instanceMatrixII = Engine.x86_64.CreateInstanceEx(model, classMatrix, (string) null);

        System.Diagnostics.Debug.Assert(Engine.x86_64.GetInstanceClassEx(model, instanceAbcd) == classAbcd);
        System.Diagnostics.Debug.Assert(Engine.x86_64.GetInstanceClassEx(model, instanceCube) == classCube);
        System.Diagnostics.Debug.Assert(Engine.x86_64.GetInstanceClassEx(model, instanceMatrixI) == Engine.x86_64.GetInstanceClassEx(model, instanceMatrixII));

        //
        //  The resulting model can be viewed in 3D-Editor.exe
        //
        Engine.x86_64.SaveModel(model, "c:\\created\\myFile.bin");
        Engine.x86_64.CloseModel(model);
    }
}