MotorXP-PM Scripting API
    Preparing search index...

    In MotorXP-PM, separate scripts define the stator, rotor, housing and shaft geometry. Each example below is a skeleton for a separate file: fill the empty arrays with geometry and material parts.

    The instance method getGeometry() returns an array of segments and arcs (Segment | Arc), while getMaterials() returns an array of parts (AnyPart) created through Part or functions such as IronPart() and GeneralPart(). Each part point must lie inside the corresponding geometry region.

    The application provides StatorObject, RotorObject, HousingObject or ShaftObject only in the corresponding element script. Use the constructor, instance and UI factory names shown below.

    export {}; // Do not delete. Required for code autocompletion in VS Code.

    function Stator() {}

    Stator.prototype = StatorObject;

    Stator.prototype.getGeometry = function () {
    // Return the segments and arcs defining the element geometry.
    return [];
    };

    Stator.prototype.getMaterials = function () {
    // Return parts with points inside the corresponding regions.
    return [];
    };

    var stator = new Stator();

    // Element settings panel constructor.
    function StatorUI(ui) {}

    StatorUI.prototype.updateUI = function () {
    // Update UI controls from the current settings.
    };

    // Called by the application from C++.
    function createStatorUI(ui) {
    statorUI = new StatorUI(ui);
    statorUI.updateUI();
    }
    export {}; // Do not delete. Required for code autocompletion in VS Code.

    function Rotor() {}

    Rotor.prototype = RotorObject;

    Rotor.prototype.getGeometry = function () {
    // Return the segments and arcs defining the element geometry.
    return [];
    };

    Rotor.prototype.getMaterials = function () {
    // Return parts with points inside the corresponding regions.
    return [];
    };

    var rotor = new Rotor();

    // Element settings panel constructor.
    function RotorUI(ui) {}

    RotorUI.prototype.updateUI = function () {
    // Update UI controls from the current settings.
    };

    // Called by the application from C++.
    function createRotorUI(ui) {
    rotorUI = new RotorUI(ui);
    rotorUI.updateUI();
    }
    export {}; // Do not delete. Required for code autocompletion in VS Code.

    function Housing() {}

    Housing.prototype = HousingObject;

    Housing.prototype.getGeometry = function () {
    // Return the segments and arcs defining the element geometry.
    return [];
    };

    Housing.prototype.getMaterials = function () {
    // Return parts with points inside the corresponding regions.
    return [];
    };

    var housing = new Housing();

    // Element settings panel constructor.
    function HousingUI(ui) {}

    HousingUI.prototype.updateUI = function () {
    // Update UI controls from the current settings.
    };

    // Called by the application from C++.
    function createHousingUI(ui) {
    housingUI = new HousingUI(ui);
    housingUI.updateUI();
    }
    export {}; // Do not delete. Required for code autocompletion in VS Code.

    function Shaft() {}

    Shaft.prototype = ShaftObject;

    Shaft.prototype.getGeometry = function () {
    // Return the segments and arcs defining the element geometry.
    return [];
    };

    Shaft.prototype.getMaterials = function () {
    // Return parts with points inside the corresponding regions.
    return [];
    };

    var shaft = new Shaft();

    // Element settings panel constructor.
    function ShaftUI(ui) {}

    ShaftUI.prototype.updateUI = function () {
    // Update UI controls from the current settings.
    };

    // Called by the application from C++.
    function createShaftUI(ui) {
    shaftUI = new ShaftUI(ui);
    shaftUI.updateUI();
    }