GetPerimeter

This function calculates the perimeter of an instance.

Note: internally the call does not store its results, any optimization based on known
    dependancies between instances need to be implemented on the client.
Note: due to internal structure using already calculated vertices/indices does not
    give any performance benefits, in opposite to GetVolume and GetArea

Syntax

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

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

using Engine;

...

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

    if (model != 0)
    {
        //
        //  Classes
        //
        Int64   classBox = Engine.x86_64.GetClassByName(model, "Box");

        //
        //  Datatype Properties (attributes)
        //
        Int64   propertyLength = Engine.x86_64.GetPropertyByName(model, "length"),
                propertyWidth = Engine.x86_64.GetPropertyByName(model, "width"),
                propertyHeight = Engine.x86_64.GetPropertyByName(model, "height");

        //
        //  Instances (creating)
        //
        Int64   instanceBox = Engine.x86_64.CreateInstance(classBox, (string) null);

        double  length = 2.8,
                width = 1.3,
                height = 1.4;

        Engine.x86_64.SetDatatypeProperty(instanceBox, propertyLength, ref length, 1);
        Engine.x86_64.SetDatatypeProperty(instanceBox, propertyWidth, ref width, 1);
        Engine.x86_64.SetDatatypeProperty(instanceBox, propertyHeight, ref height, 1);

        double  perimeter = Engine.x86_64.GetPerimeter(instanceBox);

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