MorphBox class

The MorphBox class gives you access to morph boxes in PRIMER. More...

The PRIMER JavaScript API provides many class constants, properties and methods. For Arup to be able to extend and enhance the API in the future any constant, property or method names beginning with a lowercase or uppercase letter are reserved.
If you need to add your own properties or methods to one of the existing classes then to avoid any potential future conflict you should ensure that the name begins with either an underscore (_) or a dollar sign ($) or the name is prefixed with your own unique identifier.
For example if company 'ABC' need to add a property called 'example' then to avoid any potential future conflict use one of:

Class functions

Member functions

MorphBox properties

Name Type Description
exists (read only) logical true if box exists, false if referred to but not defined.
include integer The Include file number that the box is in.
label integer MorphBox number.
model (read only) integer The Model number that the box is in.
nx (read only) integer Number of morph points in parametric X direction
ny (read only) integer Number of morph points in parametric Y direction
nz (read only) integer Number of morph points in parametric Z direction
setid (read only) integer ID for node set of nodes dragged with the box. This will be a *SET_NODE_COLUMN containing the nodes together with their parametric coordinates in X, Y, Z. It is strongly discouraged to edit the contents of this set or the column data manually.

Detailed Description

The MorphBox class allows you to create, modify and manipulate morph boxes. See the documentation below for more details.

Constructor

new MorphBox(Model[Model], label[integer], flag[Flag], options (optional)[object])

Description

Create a new MorphBox object around flagged items.

Arguments

  • Model (Model)

    Model that morph box will be created in

  • label (integer)

    MorphBox number

  • flag (Flag)

    Flag set on the entities (for example nodes, elements and/or parts) that you want to create the box around

  • options (optional) (object)

    Options to create the box.

    Object has the following properties:

    Name Type Description
    csys (optional) integer Coordinate system for local coordinates. Leave undefined if using global coordinates or if local coordinate system defined with n1, n2 and n3.
    n1 (optional) integer Node 1 label for local coordinate. Leave undefined if using global coordinates or if local coordinate system defined with csys.
    n2 (optional) integer Node 2 label for local coordinate. Leave undefined if using global coordinates or if local coordinate system defined with csys.
    n3 (optional) integer Node 3 label for local coordinate. Leave undefined if using global coordinates or if local coordinate system defined with csys.
    nx (optional) integer Number of points in X direction of box (assumed to be 2 for linear box if omitted)
    ny (optional) integer Number of points in Y direction of box (assumed to be 2 for linear box if omitted)
    nz (optional) integer Number of points in Z direction of box (assumed to be 2 for linear box if omitted)
    points (optional) Array of integers Array of integers of depth 3 containing the morph point IDs. This should be omitted in the (default) case of also creating new morph points together with the morph box at the locations based on the bounding box of the flagged items. If this array contains 'nx' by 'ny' by 'nz' existing morph points, the morph box is attached to these points, and 'csys', 'n1', 'n2', 'n3' will be irrelevant. Each 'points[i][j][k]' should contain the morph point ID to be added at index i in local X direction, index j in local Y direction and index k in local Z direction. The box will then still contain flagged nodes only, but nodes geometrically outside the volume of the morph points will not be included either.

    Returns

    MorphBox object

    Return type

    MorphBox

    Example

    To create a new morph box in model m with label 100 and 2 by 2 by 2 points (linear in each coordinate direction) around all items flagged with flag in global coordinates:

    var box = new MorphBox(m, 100, flag);

    To create a new morph box in model m with label 100 and 4 by 4 by 2 points (cubic in parametric X and Y directions and linear in Z direction) around all flagged items in local coordinates determined by nodes 11, 12 and 13:

    var options = new Object();
    options.nx = 4;
    options.ny = 4;
    options.nz = 2;
    options.n1 = 11;
    options.n2 = 12;
    options.n3 = 13;
    var box = new MorphBox(m, 100, flag, options);

    Suppose there are already morph points 1, 2, 3, 4, 5, 6, 7, 8 in model m at coordinates (0, 0, 0), (0, 0, 100), (0, 100, 0), (0, 100, 100), (100, 0, 0), (100, 0, 100), (100, 100, 0), (100, 100, 100) respectively. To create a new linear morph box between these points containing flagged items inside their volume:

    var options = new Object();
    options.points = [[[1,2],[3,4]],[[5,6],[7,8]]];
    var box = new MorphBox(m, 100, flag, options);

    Details of functions

    ApplyMorphing(redraw (optional)[boolean])

    Description

    Recalculates the X, Y and Z coordinates of all nodes linked to the morph box by the *SET_NODE_COLUMN. This should be called when coordinates of morph points have changed and you wish to apply the morphing. If several morph point positions on the same box change, then it is more speed-efficient to call this function only once for the box.

    Arguments

  • redraw (optional) (boolean)

    If model should be redrawn or not. If omitted redraw is false. If you want to apply the morphing to several boxes and only redraw after the last one then use false for all redraws apart from the last one. Alternatively you can redraw using Model.UpdateGraphics().

    Returns

    No return value

    Example

    To calculate all global X, Y and Z coordinates for the morphed nodes for box b:

    b.ApplyMorphing();


    AssociateComment(Comment[Comment])

    Description

    Associates a comment with a box.

    Arguments

  • Comment (Comment)

    Comment that will be attached to the box

    Returns

    No return value

    Example

    To associate comment c to the box b:

    b.AssociateComment(c);


    Blank()

    Description

    Blanks the box

    Arguments

    No arguments

    Returns

    No return value

    Example

    To blank box b:

    b.Blank();


    BlankAll(Model[Model], redraw (optional)[boolean]) [static]

    Description

    Blanks all of the boxs in the model.

    Arguments

  • Model (Model)

    Model that all boxs will be blanked in

  • redraw (optional) (boolean)

    If model should be redrawn or not. If omitted redraw is false. If you want to do several (un)blanks and only redraw after the last one then use false for all redraws apart from the last one. Alternatively you can redraw using View.Redraw().

    Returns

    No return value

    Example

    To blank all of the boxs in model m:

    MorphBox.BlankAll(m);


    BlankFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]

    Description

    Blanks all of the flagged boxs in the model.

    Arguments

  • Model (Model)

    Model that all the flagged boxs will be blanked in

  • flag (Flag)

    Flag set on the boxs that you want to blank

  • redraw (optional) (boolean)

    If model should be redrawn or not. If omitted redraw is false. If you want to do several (un)blanks and only redraw after the last one then use false for all redraws apart from the last one. Alternatively you can redraw using View.Redraw().

    Returns

    No return value

    Example

    To blank all of the boxs in model m flagged with f:

    MorphBox.BlankFlagged(m, f);


    Blanked()

    Description

    Checks if the box is blanked or not.

    Arguments

    No arguments

    Returns

    true if blanked, false if not.

    Return type

    Boolean

    Example

    To check if box b is blanked:

    if (b.Blanked() ) do_something...


    ClearFlag(flag[Flag])

    Description

    Clears a flag on the box.

    Arguments

  • flag (Flag)

    Flag to clear on the box

    Returns

    No return value

    Example

    To clear flag f for box b:

    b.ClearFlag(f);


    Copy(range (optional)[boolean])

    Description

    Copies the box. The target include of the copied box can be set using Options.copy_target_include.

    Arguments

  • range (optional) (boolean)

    If you want to keep the copied item in the range specified for the current include. Default value is false. To set current include, use Include.MakeCurrentLayer().

    Returns

    MorphBox object

    Return type

    MorphBox

    Example

    To copy box b into box z:

    var z = b.Copy();


    DetachComment(Comment[Comment])

    Description

    Detaches a comment from a box.

    Arguments

  • Comment (Comment)

    Comment that will be detached from the box

    Returns

    No return value

    Example

    To detach comment c from the box b:

    b.DetachComment(c);


    Error(message[string], details (optional)[string])

    Description

    Adds an error for box. For more details on checking see the Check class.

    Arguments

  • message (string)

    The error message to give

  • details (optional) (string)

    An optional detailed error message

    Returns

    No return value

    Example

    To add an error message "My custom error" for box b:

    b.Error("My custom error");


    First(Model[Model]) [static]

    Description

    Returns the first box in the model.

    Arguments

  • Model (Model)

    Model to get first box in

    Returns

    MorphBox object (or null if there are no boxs in the model).

    Return type

    MorphBox

    Example

    To get the first box in model m:

    var b = MorphBox.First(m);


    FirstFreeLabel(Model[Model], layer (optional)[Include number]) [static]

    Description

    Returns the first free box label in the model. Also see MorphBox.LastFreeLabel(), MorphBox.NextFreeLabel() and Model.FirstFreeItemLabel().

    Arguments

  • Model (Model)

    Model to get first free box label in

  • layer (optional) (Include number)

    Include file (0 for the main file) to search for labels in (Equivalent to First free in layer in editing panels). If omitted the whole model will be used (Equivalent to First free in editing panels).

    Returns

    MorphBox label.

    Return type

    Number

    Example

    To get the first free box label in model m:

    var label = MorphBox.FirstFreeLabel(m);


    FlagAll(Model[Model], flag[Flag]) [static]

    Description

    Flags all of the boxs in the model with a defined flag.

    Arguments

  • Model (Model)

    Model that all boxs will be flagged in

  • flag (Flag)

    Flag to set on the boxs

    Returns

    No return value

    Example

    To flag all of the boxs with flag f in model m:

    MorphBox.FlagAll(m, f);


    FlagAllMorphedConnections(model[Model], flag[integer]) [static]

    Description

    Flags all connections, in a given model, that have been morphed since their last remake. This includes connections that have been morphed by a morph box that has since been deleted.

    Arguments

  • model (Model)

    Model containing desired connections.

  • flag (integer)

    Flag to mark morphed connections.

    Returns

    true if successful, false if not.

    Return type

    Boolean

    Example

    To flag all morphed connections in Model m with flag.

    var flag = AllocateFlag();
       MorphBox.FlagAllMorphedConnections(m, flag);


    FlagMorphedConnections(flag[integer])

    Description

    Flags all connections that have been morphed, by a givine morph box, since their last remake. A connection could be morphed by one morph box and not another, therefore calling this function on two boxes that share a connection may produce different results depending on which box the function is called for. E.g. morb1 and morb2 share conx1, morb1 gets morphed whereas morb2 remains unchanged. Calling this function for morb1 will flag conx1, however calling the function for morb2 won't flag conx1.

    Arguments

  • flag (integer)

    Flag to mark morphed connections.

    Returns

    true if successful, false if not.

    Return type

    Boolean

    Example

    To flag all morphed connections in a MorphBox with flag.

    var flag = AllocateFlag();
       box.FlagMorphedConnections(flag);


    Flagged(flag[Flag])

    Description

    Checks if the box is flagged or not.

    Arguments

  • flag (Flag)

    Flag to test on the box

    Returns

    true if flagged, false if not.

    Return type

    Boolean

    Example

    To check if box b has flag f set on it:

    if (b.Flagged(f) ) do_something...


    ForEach(Model[Model], func[function], extra (optional)[any]) [static]

    Description

    Calls a function for each box in the model.
    Note that ForEach has been designed to make looping over boxs as fast as possible and so has some limitations.
    Firstly, a single temporary MorphBox object is created and on each function call it is updated with the current box data. This means that you should not try to store the MorphBox object for later use (e.g. in an array) as it is temporary.
    Secondly, you cannot create new boxs inside a ForEach loop.

    Arguments

  • Model (Model)

    Model that all boxs are in

  • func (function)

    Function to call for each box

  • extra (optional) (any)

    An optional extra object/array/string etc that will appended to arguments when calling the function

    Returns

    No return value

    Example

    To call function test for all of the boxs in model m:

    MorphBox.ForEach(m, test);
    function test(b)
    {
    // b is MorphBox object
    }

    To call function test for all of the boxs in model m with optional object:

    var data = { x:0, y:0 };
    MorphBox.ForEach(m, test, data);
    function test(b, extra)
    {
    // b is MorphBox object
    // extra is data
    }


    GetAll(Model[Model], property (optional)[string]) [static]

    Description

    Returns an array of MorphBox objects or properties for all of the boxs in a model in PRIMER. If the optional property argument is not given then an array of MorphBox objects is returned. If the property argument is given, that property value for each box is returned in the array instead of a MorphBox object

    Arguments

  • Model (Model)

    Model to get boxs from

  • property (optional) (string)

    Name for property to get for all boxs in the model

    Returns

    Array of MorphBox objects or properties

    Return type

    Array

    Example

    To make an array of MorphBox objects for all of the boxs in model m:

    var a = MorphBox.GetAll(m);

    To return an array containing the value of property 'foo' (for example 'x' for a node) for each box in model m:

    var a = MorphBox.GetAll(m, 'foo');


    GetComments()

    Description

    Extracts the comments associated to a box.

    Arguments

    No arguments

    Returns

    Array of Comment objects (or null if there are no comments associated to the node).

    Return type

    Array

    Example

    To get the array of comments associated to the box b:

    var comm_array = b.GetComments();


    GetFlagged(Model[Model], flag[Flag], property (optional)[string]) [static]

    Description

    Returns an array of MorphBox objects for all of the flagged boxs in a model in PRIMER If the optional property argument is not given then an array of MorphBox objects is returned. If the property argument is given, then that property value for each box is returned in the array instead of a MorphBox object

    Arguments

  • Model (Model)

    Model to get boxs from

  • flag (Flag)

    Flag set on the boxs that you want to retrieve

  • property (optional) (string)

    Name for property to get for all flagged boxs in the model

    Returns

    Array of MorphBox objects or properties

    Return type

    Array

    Example

    To make an array of MorphBox objects for all of the boxs in model m flagged with f:

    var b = MorphBox.GetFlagged(m, f);

    To return an array containing the value of property 'foo' (for example 'x' for a node) for all of the boxs in model m flagged with f:

    var a = MorphBox.GetFlagged(m, f, 'foo');


    GetFromID(Model[Model], number[integer]) [static]

    Description

    Returns the MorphBox object for a box ID.

    Arguments

  • Model (Model)

    Model to find the box in

  • number (integer)

    number of the box you want the MorphBox object for

    Returns

    MorphBox object (or null if box does not exist).

    Return type

    MorphBox

    Example

    To get the MorphBox object for box 100 in model m

    var b = MorphBox.GetFromID(m, 100);


    GetParameter(prop[string])

    Description

    Checks if a MorphBox property is a parameter or not. Note that object properties that are parameters are normally returned as the integer or float parameter values as that is virtually always what the user would want. For this function to work the JavaScript interpreter must use the parameter name instead of the value. This can be done by setting the Options.property_parameter_names option to true before calling the function and then resetting it to false afterwards.. This behaviour can also temporarily be switched by using the MorphBox.ViewParameters() method and 'method chaining' (see the examples below).

    Arguments

  • prop (string)

    box property to get parameter for

    Returns

    Parameter object if property is a parameter, null if not.

    Return type

    Parameter

    Example

    To check if MorphBox property b.example is a parameter:

    Options.property_parameter_names = true;
    if (b.GetParameter(b.example) ) do_something...
    Options.property_parameter_names = false;

    To check if MorphBox property b.example is a parameter by using the GetParameter method:

    if (b.ViewParameters().GetParameter(b.example) ) do_something...


    GetPoint(xindex[integer], yindex[integer], zindex[integer])

    Description

    Returns the morph point ID on the morph box at indices in X, Y and Z directions.

    Arguments

  • xindex (integer)

    Index of the point in X direction. Note that indices start at 0, so it should be 0 for the points with the smallest parameteric X coordinate and box.nx-1 for the points with the highest X.

  • yindex (integer)

    Index of the point in Y direction. Note that indices start at 0, so it should be 0 for the points with the smallest parameteric Y coordinate and box.ny-1 for the points with the highest Y.

  • zindex (integer)

    Index of the point in Z direction. Note that indices start at 0, so it should be 0 for the points with the smallest parameteric Z coordinate and box.nz-1 for the points with the highest Z.

    Returns

    A MorphPoint object for the point on the box at given indices.

    Return type

    MorphPoint

    Example

    To get the 2nd point on the edge along the local Y direction and at highest local X and lowest local Z coordinate:

    var point = box.GetPoint(box.nx-1, 1, 0);


    Keyword()

    Description

    Returns the keyword for this morph box (*MORPH_BOX or *MORPH_BOX_HIGH_ORDER). Note that a carriage return is not added. See also MorphBox.KeywordCards()

    Arguments

    No arguments

    Returns

    string containing the keyword.

    Return type

    String

    Example

    To get the keyword for morph box b:

    var key = b.Keyword();


    KeywordCards()

    Description

    Returns the keyword cards for the morph box. Note that a carriage return is not added. See also MorphBox.Keyword()

    Arguments

    No arguments

    Returns

    string containing the cards.

    Return type

    String

    Example

    To get the cards for morph box b:

    var cards = b.KeywordCards();


    Last(Model[Model]) [static]

    Description

    Returns the last box in the model.

    Arguments

  • Model (Model)

    Model to get last box in

    Returns

    MorphBox object (or null if there are no boxs in the model).

    Return type

    MorphBox

    Example

    To get the last box in model m:

    var b = MorphBox.Last(m);


    LastFreeLabel(Model[Model], layer (optional)[Include number]) [static]

    Description

    Returns the last free box label in the model. Also see MorphBox.FirstFreeLabel(), MorphBox.NextFreeLabel() and see Model.LastFreeItemLabel()

    Arguments

  • Model (Model)

    Model to get last free box label in

  • layer (optional) (Include number)

    Include file (0 for the main file) to search for labels in (Equivalent to Highest free in layer in editing panels). If omitted the whole model will be used.

    Returns

    MorphBox label.

    Return type

    Number

    Example

    To get the last free box label in model m:

    var label = MorphBox.LastFreeLabel(m);


    Next()

    Description

    Returns the next box in the model.

    Arguments

    No arguments

    Returns

    MorphBox object (or null if there are no more boxs in the model).

    Return type

    MorphBox

    Example

    To get the box in model m after box b:

    var b = b.Next();


    NextFreeLabel(Model[Model], layer (optional)[Include number]) [static]

    Description

    Returns the next free (highest+1) box label in the model. Also see MorphBox.FirstFreeLabel(), MorphBox.LastFreeLabel() and Model.NextFreeItemLabel()

    Arguments

  • Model (Model)

    Model to get next free box label in

  • layer (optional) (Include number)

    Include file (0 for the main file) to search for labels in (Equivalent to Highest+1 in layer in editing panels). If omitted the whole model will be used (Equivalent to Highest+1 in editing panels).

    Returns

    MorphBox label.

    Return type

    Number

    Example

    To get the next free box label in model m:

    var label = MorphBox.NextFreeLabel(m);


    Pick(prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean], button text (optional)[string]) [static]

    Description

    Allows the user to pick a box.

    Arguments

  • prompt (string)

    Text to display as a prompt to the user

  • limit (optional) (Model or Flag)

    If the argument is a Model then only boxs from that model can be picked. If the argument is a Flag then only boxs that are flagged with limit can be selected. If omitted, or null, any boxs from any model can be selected. from any model.

  • modal (optional) (boolean)

    If picking is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the pick will be modal.

  • button text (optional) (string)

    By default the window with the prompt will have a button labelled 'Cancel' which if pressed will cancel the pick and return null. If you want to change the text on the button use this argument. If omitted 'Cancel' will be used.

    Returns

    MorphBox object (or null if not picked)

    Return type

    MorphBox

    Example

    To pick a box from model m giving the prompt 'Pick box from screen':

    var b = MorphBox.Pick('Pick box from screen', m);


    Previous()

    Description

    Returns the previous box in the model.

    Arguments

    No arguments

    Returns

    MorphBox object (or null if there are no more boxs in the model).

    Return type

    MorphBox

    Example

    To get the box in model m before box b:

    var b = b.Previous();


    RenumberAll(Model[Model], start[integer]) [static]

    Description

    Renumbers all of the boxs in the model.

    Arguments

  • Model (Model)

    Model that all boxs will be renumbered in

  • start (integer)

    Start point for renumbering

    Returns

    No return value

    Example

    To renumber all of the boxs in model m, from 1000000:

    MorphBox.RenumberAll(m, 1000000);


    RenumberFlagged(Model[Model], flag[Flag], start[integer]) [static]

    Description

    Renumbers all of the flagged boxs in the model.

    Arguments

  • Model (Model)

    Model that all the flagged boxs will be renumbered in

  • flag (Flag)

    Flag set on the boxs that you want to renumber

  • start (integer)

    Start point for renumbering

    Returns

    No return value

    Example

    To renumber all of the boxs in model m flagged with f, from 1000000:

    MorphBox.RenumberFlagged(m, f, 1000000);


    Reset(redraw (optional)[boolean])

    Description

    Resets the morph box to its initial position and updates the coordinates of all its nodes.

    Arguments

  • redraw (optional) (boolean)

    If model should be redrawn or not. If omitted redraw is false. If you want to reset several boxes and only redraw after the last one then use false for all redraws apart from the last one. Alternatively you can redraw using Model.UpdateGraphics().

    Returns

    No return value

    Example

    To reset box b:

    b.Reset();


    Select(flag[Flag], prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean]) [static]

    Description

    Allows the user to select boxs using standard PRIMER object menus.

    Arguments

  • flag (Flag)

    Flag to use when selecting boxs

  • prompt (string)

    Text to display as a prompt to the user

  • limit (optional) (Model or Flag)

    If the argument is a Model then only boxs from that model can be selected. If the argument is a Flag then only boxs that are flagged with limit can be selected (limit should be different to flag). If omitted, or null, any boxs can be selected. from any model.

  • modal (optional) (boolean)

    If selection is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the selection will be modal.

    Returns

    Number of boxs selected or null if menu cancelled

    Return type

    Number

    Example

    To select boxs from model m, flagging those selected with flag f, giving the prompt 'Select boxs':

    MorphBox.Select(f, 'Select boxs', m);

    To select boxs, flagging those selected with flag f but limiting selection to boxs flagged with flag l, giving the prompt 'Select boxs':

    MorphBox.Select(f, 'Select boxs', l);


    SetFlag(flag[Flag])

    Description

    Sets a flag on the box.

    Arguments

  • flag (Flag)

    Flag to set on the box

    Returns

    No return value

    Example

    To set flag f for box b:

    b.SetFlag(f);


    SetMorphConnections(status[boolean]) [static]

    Description

    Turns Morph Connections on/off.

    Arguments

  • status (boolean)

    true turns Morph Connections on. false turns Morph Connections off.

    Returns

    No return value.

    Example

    To turn Morph Connections on.

    MorphBox.SetMorphConnections(true);


    SetPointID(xindex[integer], yindex[integer], zindex[integer], id[integer])

    Description

    Replaces the morph point ID on the array, whose size depends on the orders in X, Y and Z directions, with the given new ID.

    Arguments

  • xindex (integer)

    Index of the point in X direction. Note that indices start at 0, so it should be 0 for the points with the smallest parameteric X coordinate and box.nx-1 for the points with the highest X.

  • yindex (integer)

    Index of the point in Y direction. Note that indices start at 0, so it should be 0 for the points with the smallest parameteric Y coordinate and box.ny-1 for the points with the highest Y.

  • zindex (integer)

    Index of the point in Z direction. Note that indices start at 0, so it should be 0 for the points with the smallest parameteric Z coordinate and box.nz-1 for the points with the highest Z.

  • id (integer)

    New MorphPoint id.

    Returns

    No return value

    Example

    To replace the 2nd point on the edge along the local X direction and at lowest local Y and highest local Z coordinate with point 101:

    box.SetPointID(1, 0, box.nz-1, 101);


    Sketch(redraw (optional)[boolean])

    Description

    Sketches the box. The box will be sketched until you either call MorphBox.Unsketch(), MorphBox.UnsketchAll(), Model.UnsketchAll(), or delete the model

    Arguments

  • redraw (optional) (boolean)

    If model should be redrawn or not after the box is sketched. If omitted redraw is true. If you want to sketch several boxs and only redraw after the last one then use false for redraw and call View.Redraw().

    Returns

    No return value

    Example

    To sketch box b:

    b.Sketch();


    SketchFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]

    Description

    Sketches all of the flagged boxs in the model. The boxs will be sketched until you either call MorphBox.Unsketch(), MorphBox.UnsketchFlagged(), Model.UnsketchAll(), or delete the model

    Arguments

  • Model (Model)

    Model that all the flagged boxs will be sketched in

  • flag (Flag)

    Flag set on the boxs that you want to sketch

  • redraw (optional) (boolean)

    If model should be redrawn or not after the boxs are sketched. If omitted redraw is true. If you want to sketch flagged boxs several times and only redraw after the last one then use false for redraw and call View.Redraw().

    Returns

    No return value

    Example

    To sketch all boxs flagged with flag in model m:

    MorphBox.SketchFlagged(m, flag);


    Total(Model[Model], exists (optional)[boolean]) [static]

    Description

    Returns the total number of boxs in the model.

    Arguments

  • Model (Model)

    Model to get total for

  • exists (optional) (boolean)

    true if only existing boxs should be counted. If false or omitted referenced but undefined boxs will also be included in the total.

    Returns

    number of boxs

    Return type

    Number

    Example

    To get the total number of boxs in model m:

    var total = MorphBox.Total(m);


    Unblank()

    Description

    Unblanks the box

    Arguments

    No arguments

    Returns

    No return value

    Example

    To unblank box b:

    b.Unblank();


    UnblankAll(Model[Model], redraw (optional)[boolean]) [static]

    Description

    Unblanks all of the boxs in the model.

    Arguments

  • Model (Model)

    Model that all boxs will be unblanked in

  • redraw (optional) (boolean)

    If model should be redrawn or not. If omitted redraw is false. If you want to do several (un)blanks and only redraw after the last one then use false for all redraws apart from the last one. Alternatively you can redraw using View.Redraw().

    Returns

    No return value

    Example

    To unblank all of the boxs in model m:

    MorphBox.UnblankAll(m);


    UnblankFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]

    Description

    Unblanks all of the flagged boxs in the model.

    Arguments

  • Model (Model)

    Model that the flagged boxs will be unblanked in

  • flag (Flag)

    Flag set on the boxs that you want to unblank

  • redraw (optional) (boolean)

    If model should be redrawn or not. If omitted redraw is false. If you want to do several (un)blanks and only redraw after the last one then use false for all redraws apart from the last one. Alternatively you can redraw using View.Redraw().

    Returns

    No return value

    Example

    To unblank all of the boxs in model m flagged with f:

    MorphBox.UnblankFlagged(m, f);


    UnflagAll(Model[Model], flag[Flag]) [static]

    Description

    Unsets a defined flag on all of the boxs in the model.

    Arguments

  • Model (Model)

    Model that the defined flag for all boxs will be unset in

  • flag (Flag)

    Flag to unset on the boxs

    Returns

    No return value

    Example

    To unset the flag f on all the boxs in model m:

    MorphBox.UnflagAll(m, f);


    Unsketch(redraw (optional)[boolean])

    Description

    Unsketches the box.

    Arguments

  • redraw (optional) (boolean)

    If model should be redrawn or not after the box is unsketched. If omitted redraw is true. If you want to unsketch several boxs and only redraw after the last one then use false for redraw and call View.Redraw().

    Returns

    No return value

    Example

    To unsketch box b:

    b.Unsketch();


    UnsketchAll(Model[Model], redraw (optional)[boolean]) [static]

    Description

    Unsketches all boxs.

    Arguments

  • Model (Model)

    Model that all boxs will be unblanked in

  • redraw (optional) (boolean)

    If model should be redrawn or not after the boxs are unsketched. If omitted redraw is true. If you want to unsketch several things and only redraw after the last one then use false for redraw and call View.Redraw().

    Returns

    No return value

    Example

    To unsketch all boxs in model m:

    MorphBox.UnsketchAll(m);


    UnsketchFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]

    Description

    Unsketches all flagged boxs in the model.

    Arguments

  • Model (Model)

    Model that all boxs will be unsketched in

  • flag (Flag)

    Flag set on the boxs that you want to unsketch

  • redraw (optional) (boolean)

    If model should be redrawn or not after the boxs are unsketched. If omitted redraw is true. If you want to unsketch several things and only redraw after the last one then use false for redraw and call View.Redraw().

    Returns

    No return value

    Example

    To unsketch all boxs flagged with flag in model m:

    MorphBox.UnsketchAll(m, flag);


    UpdateParametricCoordinates()

    Description

    Recalculates parametric X, Y, Z coordinates for each node in the *SET_NODE_COLUMN associated with the morph box. This needs to be called whenever morph points on the box or their coordinates have been changed manually and you wish to keep all nodes at their intrinsic global X, Y, Z coordinates. Provided Morph Connections is on (see MorphBox.SetMorphConnections()), this will also force PRIMER to recalculate the parametric coordinates for any connections in the morph box next time one of its morph points is moved.

    Arguments

    No arguments

    Returns

    No return value

    Example

    To recalculate all X, Y and Z coordinates for box b:

    b.UpdateParametricCoordinates();


    ViewParameters()

    Description

    Object properties that are parameters are normally returned as the integer or float parameter values as that is virtually always what the user would want. This function temporarily changes the behaviour so that if a property is a parameter the parameter name is returned instead. This can be used with 'method chaining' (see the example below) to make sure a property argument is correct.

    Arguments

    No arguments

    Returns

    MorphBox object.

    Return type

    MorphBox

    Example

    To check if MorphBox property b.example is a parameter by using the MorphBox.GetParameter() method:

    if (b.ViewParameters().GetParameter(b.example) ) do_something...


    Warning(message[string], details (optional)[string])

    Description

    Adds a warning for box. For more details on checking see the Check class.

    Arguments

  • message (string)

    The warning message to give

  • details (optional) (string)

    An optional detailed warning message

    Returns

    No return value

    Example

    To add a warning message "My custom warning" for box b:

    b.Warning("My custom warning");


    Xrefs()

    Description

    Returns the cross references for this box.

    Arguments

    No arguments

    Returns

    Xrefs object.

    Return type

    Xrefs

    Example

    To get the cross references for box b:

    var xrefs = b.Xrefs();


    toString()

    Description

    Creates a string containing the morph box data in keyword format. Note that this contains the keyword header and the keyword cards. See also MorphBox.Keyword() and MorphBox.KeywordCards().

    Arguments

    No arguments

    Returns

    string

    Return type

    String

    Example

    To get data for morph box b in keyword format

    var s = b.toString();