PrescribedMotion class

The PrescribedMotion class gives you access to define boundary prescribed motion cards 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

PrescribedMotion constants

Name Description
PrescribedMotion.EDGE_UVW Prescribed motion is *BOUNDARY_PRESCRIBED_MOTION_EDGE_UVW.
PrescribedMotion.FACE_XYZ Prescribed motion is *BOUNDARY_PRESCRIBED_MOTION_FACE_XYZ.
PrescribedMotion.NODE Prescribed motion is *BOUNDARY_PRESCRIBED_MOTION_NODE.
PrescribedMotion.NRBC Prescribed motion is *BOUNDARY_PRESCRIBED_MOTION_RIGID, with an NRB, not a part.
PrescribedMotion.NRBC_LOCAL Prescribed motion is *BOUNDARY_PRESCRIBED_MOTION_RIGID_LOCAL, with an NRB, not a part.
PrescribedMotion.POINT_UVW Prescribed motion is *BOUNDARY_PRESCRIBED_MOTION_POINT_UVW.
PrescribedMotion.RIGID Prescribed motion is *BOUNDARY_PRESCRIBED_MOTION_RIGID.
PrescribedMotion.RIGID_LOCAL Prescribed motion is *BOUNDARY_PRESCRIBED_MOTION_RIGID_LOCAL.
PrescribedMotion.SET Prescribed motion is *BOUNDARY_PRESCRIBED_MOTION_SET.
PrescribedMotion.SET_BOX Prescribed motion is *BOUNDARY_PRESCRIBED_MOTION_SET_BOX.
PrescribedMotion.SET_EDGE_UVW Prescribed motion is *BOUNDARY_PRESCRIBED_MOTION_SET_EDGE_UVW.
PrescribedMotion.SET_FACE_XYZ Prescribed motion is *BOUNDARY_PRESCRIBED_MOTION_SET_FACE_XYZ.
PrescribedMotion.SET_LINE Prescribed motion is *BOUNDARY_PRESCRIBED_MOTION_SET_LINE.
PrescribedMotion.SET_POINT_UVW Prescribed motion is *BOUNDARY_PRESCRIBED_MOTION_SET_POINT_UVW.
PrescribedMotion.SET_SEGMENT Prescribed motion is *BOUNDARY_PRESCRIBED_MOTION_SET_SEGMENT.

PrescribedMotion properties

Name Type Description
birth real Birth time
bndout2dynain logical true if _BNDOUT2DYNAIN option is set, false if not
death real Death time
dof integer Degree of freedom
exists (read only) logical true if boundary prescribed motion exists, false if referred to but not defined.
form integer Formulation type. Used for Card 6.
heading string PrescribedMotion heading
id logical true if _ID option is set, false if not
include integer The Include file number that the boundary prescribed motion is in.
label integer PrescribedMotion number.
lcid integer Load curve of motion vs. time
lrb integer Lead rigid body for measuring relative displacement
model (read only) integer The Model number that the boundary prescribed motion is in.
nbeg integer Node ID of a starting node. Used for PrescribedMotion.SET_LINE
nend integer Node ID of a ending node. Used for PrescribedMotion.SET_LINE
node1 integer Optional orientation node for relative displacement
node2 integer Optional orientation node for relative displacement
offset1 real Offset 1 for types 9-11
offset2 real Offset 2 for types 9-11
prmr string String representing the name of the parameter to be output to the dynain file. Used when PrescribedMotion.bndout2dynain is set to true.
sf real Load curve scale factor
sfd real Scale factor for displacement penalty stiffness. Used for Card 6.
sfr real This property is deprecated in version 14.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.
Scale factor for rotational penalty stiffness. Used for Card 6.  [deprecated]
type constant The Prescribed motion type. Can be PrescribedMotion.NODE, PrescribedMotion.SET, PrescribedMotion.RIGID, PrescribedMotion.RIGID_LOCAL, PrescribedMotion.NRBC, PrescribedMotion.NRBC_LOCAL, PrescribedMotion.SET_BOX, PrescribedMotion.SET_SEGMENT, PrescribedMotion.SET_LINE, PrescribedMotion.POINT_UVW, PrescribedMotion.EDGE_UVW, PrescribedMotion.FACE_XYZ, PrescribedMotion.SET_POINT_UVW, PrescribedMotion.SET_EDGE_UVW or PrescribedMotion.SET_FACE_XYZ
typeid integer Node ID, node set ID, part ID or NRB
vad integer Velocity/acceleration/displacement flag
vid integer Vector ID

Detailed Description

The PrescribedMotion class allows you to create, modify, edit and boundary prescribed motion cards. See the documentation below for more details.

Constructor

new PrescribedMotion(Model[Model], typeid[integer], dof[integer], vad[integer], lcid[integer], type[constant], label (optional)[integer], heading (optional)[string])

Description

Create a new PrescribedMotion object.

Arguments

  • Model (Model)

    Model that PrescribedMotion will be created in

  • typeid (integer)

    Node ID, node set ID or part ID

  • dof (integer)

    Degree of freedom

  • vad (integer)

    Velocity/acceleration/displacement flag

  • lcid (integer)

    Load curve for motion

  • type (constant)

    Specify the type of prescribed motion (Can be PrescribedMotion.NODE, PrescribedMotion.SET, PrescribedMotion.RIGID, PrescribedMotion.RIGID_LOCAL, PrescribedMotion.NRBC, PrescribedMotion.NRBC_LOCAL, PrescribedMotion.SET_BOX, PrescribedMotion.SET_SEGMENT, PrescribedMotion.SET_LINE, PrescribedMotion.POINT_UVW, PrescribedMotion.EDGE_UVW, PrescribedMotion.FACE_XYZ, PrescribedMotion.SET_POINT_UVW, PrescribedMotion.SET_EDGE_UVW or PrescribedMotion.SET_FACE_XYZ)

  • label (optional) (integer)

    PrescribedMotion number

  • heading (optional) (string)

    Title for the PrescribedMotion

    Returns

    PrescribedMotion object

    Return type

    PrescribedMotion

    Example

    To create a new displacement for node 100 in x using loadcurve 10 model m with label 200, of type SET

    var b = new PrescribedMotion(m, 100, 1, 2, 10, PrescribedMotion.SET, 200);

    Details of functions

    AnimationBackward() [static]

    Description

    Moves backward one frame of a PrescribedMotion animation (pausing animation first if required). Also see the PrescribedMotion.AnimationBegin() method which MUST be called before you start animating and the PrescribedMotion.AnimationFinish() method which MUST be called after you have finished animating.

    Arguments

    No arguments

    Returns

    No return value

    Example

    To move backward one frame of an animation:

    PrescribedMotion.AnimationBackward();


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

    Description

    Begins a PrescribedMotion animation. This MUST be called before any of the other Animation methods. Also see the PrescribedMotion.AnimationFinish() method which MUST be called after you have finished animating.

    Arguments

  • Model (Model)

    Model that PrescribedMotions are in

  • flag (Flag)

    Flag set on the PrescribedMotions that you want to animate

    Returns

    Object with the following properties:

    Name Type Description
    end real End time
    frame integer Current frame
    frames integer Number of frames
    rate integer Animation speed in fps
    repeat integer Animation repeat (0=off, 1=on)
    start real Start time
    time real Current time
    timestep real Timestep

    Return type

    object

    Example

    To begin an animation of the PrescribedMotions in model m flagged with f:

    var aprops = PrescribedMotion.AnimationBegin(m, f);


    AnimationFinish() [static]

    Description

    Finishes a PrescribedMotion animation. This MUST be called to finish animating. This will restore nodal coordinates but will not perform a graphics update. Also see the PrescribedMotion.AnimationBegin() method which MUST be called before you start animating.

    Arguments

    No arguments

    Returns

    No return value

    Example

    To finish animating:

    PrescribedMotion.AnimationFinish();


    AnimationForward() [static]

    Description

    Moves forward one frame of a PrescribedMotion animation (pausing animation first if required). Also see the PrescribedMotion.AnimationBegin() method which MUST be called before you start animating and the PrescribedMotion.AnimationFinish() method which MUST be called after you have finished animating.

    Arguments

    No arguments

    Returns

    No return value

    Example

    To move forward one frame of an animation:

    PrescribedMotion.AnimationForward();


    AnimationGetData() [static]

    Description

    Returns the animation data (pausing animation first if required). Also see the PrescribedMotion.AnimationBegin() method which MUST be called before you start animating and the PrescribedMotion.AnimationFinish() method which MUST be called after you have finished animating.

    Arguments

    No arguments

    Returns

    Object with the following properties:

    Name Type Description
    end real End time
    frame integer Current frame
    frames integer Number of frames
    rate integer Animation speed in fps
    repeat integer Animation repeat (0=off, 1=on)
    start real Start time
    time real Current time
    timestep real Timestep

    Return type

    object

    Example

    To get the current animation data:

    PrescribedMotion.AnimationGetData();


    AnimationPause() [static]

    Description

    Pauses playback of a PrescribedMotion animation. Also see the PrescribedMotion.AnimationBegin() method which MUST be called before you start animating and the PrescribedMotion.AnimationFinish() method which MUST be called after you have finished animating.

    Arguments

    No arguments

    Returns

    No return value

    Example

    To pause playback of an animation:

    PrescribedMotion.AnimationPause();


    AnimationPlay() [static]

    Description

    Starts playback of a PrescribedMotion animation. Also see the PrescribedMotion.AnimationBegin() method which MUST be called before you start animating and the PrescribedMotion.AnimationFinish() method which MUST be called after you have finished animating.
    This method should only be used from a script which implements a user interface so you can actually stop the animation! Don't forget to add a pause/stop button that calls PrescribedMotion.AnimationPause()!

    Arguments

    No arguments

    Returns

    No return value

    Example

    To start playback of an animation:

    PrescribedMotion.AnimationPlay();


    AnimationSetData(data[object]) [static]

    Description

    Sets the current animation data (pausing animation first if required). Also see the PrescribedMotion.AnimationBegin() method which MUST be called before you start animating and the PrescribedMotion.AnimationFinish() method which MUST be called after you have finished animating.

    Arguments

  • data (object)

    data returned from PrescribedMotion.AnimationBegin() or PrescribedMotion.AnimationGetData()

    Object has the following properties:

    Name Type Description
    end real End time
    frame integer Current frame
    frames integer Number of frames
    rate integer Animation speed in fps
    repeat integer Animation repeat (0=off, 1=on)
    start real Start time
    time real Current time
    timestep real Timestep

    Returns

    No return value

    Example

    To set the animation frame rate to 10 frames/sec:

    data = PrescribedMotion.AnimationGetData();
    data.rate = 10;
    PrescribedMotion.AnimationSetData(data);


    AnimationToEnd() [static]

    Description

    Moves to the end of a PrescribedMotion animation (pausing animation first if required). Also see the PrescribedMotion.AnimationBegin() method which MUST be called before you start animating and the PrescribedMotion.AnimationFinish() method which MUST be called after you have finished animating.

    Arguments

    No arguments

    Returns

    No return value

    Example

    To move to the end of an animation:

    PrescribedMotion.AnimationToEnd();


    AnimationToStart() [static]

    Description

    Moves to the start of a PrescribedMotion animation (pausing animation first if required). Also see the PrescribedMotion.AnimationBegin() method which MUST be called before you start animating and the PrescribedMotion.AnimationFinish() method which MUST be called after you have finished animating.

    Arguments

    No arguments

    Returns

    No return value

    Example

    To move to the start of an animation:

    PrescribedMotion.AnimationToStart();


    AnimationToTime() [static]

    Description

    Moves to a specific time in a PrescribedMotion animation (pausing animation first if required). Also see the PrescribedMotion.AnimationBegin() method which MUST be called before you start animating and the PrescribedMotion.AnimationFinish() method which MUST be called after you have finished animating.

    Arguments

    No arguments

    Returns

    No return value

    Example

    To move to time 28.0 in an animation:

    PrescribedMotion.AnimationToTime(28.0);


    AssociateComment(Comment[Comment])

    Description

    Associates a comment with a boundary prescribed motion.

    Arguments

  • Comment (Comment)

    Comment that will be attached to the boundary prescribed motion

    Returns

    No return value

    Example

    To associate comment c to the boundary prescribed motion b:

    b.AssociateComment(c);


    Blank()

    Description

    Blanks the boundary prescribed motion

    Arguments

    No arguments

    Returns

    No return value

    Example

    To blank boundary prescribed motion b:

    b.Blank();


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

    Description

    Blanks all of the boundary prescribed motions in the model.

    Arguments

  • Model (Model)

    Model that all boundary prescribed motions 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 boundary prescribed motions in model m:

    PrescribedMotion.BlankAll(m);


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

    Description

    Blanks all of the flagged boundary prescribed motions in the model.

    Arguments

  • Model (Model)

    Model that all the flagged boundary prescribed motions will be blanked in

  • flag (Flag)

    Flag set on the boundary prescribed motions 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 boundary prescribed motions in model m flagged with f:

    PrescribedMotion.BlankFlagged(m, f);


    Blanked()

    Description

    Checks if the boundary prescribed motion is blanked or not.

    Arguments

    No arguments

    Returns

    true if blanked, false if not.

    Return type

    Boolean

    Example

    To check if boundary prescribed motion b is blanked:

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


    ClearFlag(flag[Flag])

    Description

    Clears a flag on the boundary prescribed motion.

    Arguments

  • flag (Flag)

    Flag to clear on the boundary prescribed motion

    Returns

    No return value

    Example

    To clear flag f for boundary prescribed motion b:

    b.ClearFlag(f);


    Copy(range (optional)[boolean])

    Description

    Copies the boundary prescribed motion. The target include of the copied boundary prescribed motion 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

    PrescribedMotion object

    Return type

    PrescribedMotion

    Example

    To copy boundary prescribed motion b into boundary prescribed motion z:

    var z = b.Copy();


    DetachComment(Comment[Comment])

    Description

    Detaches a comment from a boundary prescribed motion.

    Arguments

  • Comment (Comment)

    Comment that will be detached from the boundary prescribed motion

    Returns

    No return value

    Example

    To detach comment c from the boundary prescribed motion b:

    b.DetachComment(c);


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

    Description

    Adds an error for boundary prescribed motion. 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 boundary prescribed motion b:

    b.Error("My custom error");


    First(Model[Model]) [static]

    Description

    Returns the first boundary prescribed motion in the model.

    Arguments

  • Model (Model)

    Model to get first boundary prescribed motion in

    Returns

    PrescribedMotion object (or null if there are no boundary prescribed motions in the model).

    Return type

    PrescribedMotion

    Example

    To get the first boundary prescribed motion in model m:

    var b = PrescribedMotion.First(m);


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

    Description

    Returns the first free boundary prescribed motion label in the model. Also see PrescribedMotion.LastFreeLabel(), PrescribedMotion.NextFreeLabel() and Model.FirstFreeItemLabel().

    Arguments

  • Model (Model)

    Model to get first free boundary prescribed motion 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

    PrescribedMotion label.

    Return type

    Number

    Example

    To get the first free boundary prescribed motion label in model m:

    var label = PrescribedMotion.FirstFreeLabel(m);


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

    Description

    Flags all of the boundary prescribed motions in the model with a defined flag.

    Arguments

  • Model (Model)

    Model that all boundary prescribed motions will be flagged in

  • flag (Flag)

    Flag to set on the boundary prescribed motions

    Returns

    No return value

    Example

    To flag all of the boundary prescribed motions with flag f in model m:

    PrescribedMotion.FlagAll(m, f);


    Flagged(flag[Flag])

    Description

    Checks if the boundary prescribed motion is flagged or not.

    Arguments

  • flag (Flag)

    Flag to test on the boundary prescribed motion

    Returns

    true if flagged, false if not.

    Return type

    Boolean

    Example

    To check if boundary prescribed motion 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 boundary prescribed motion in the model.
    Note that ForEach has been designed to make looping over boundary prescribed motions as fast as possible and so has some limitations.
    Firstly, a single temporary PrescribedMotion object is created and on each function call it is updated with the current boundary prescribed motion data. This means that you should not try to store the PrescribedMotion object for later use (e.g. in an array) as it is temporary.
    Secondly, you cannot create new boundary prescribed motions inside a ForEach loop.

    Arguments

  • Model (Model)

    Model that all boundary prescribed motions are in

  • func (function)

    Function to call for each boundary prescribed motion

  • 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 boundary prescribed motions in model m:

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

    To call function test for all of the boundary prescribed motions in model m with optional object:

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


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

    Description

    Returns an array of PrescribedMotion objects or properties for all of the boundary prescribed motions in a model in PRIMER. If the optional property argument is not given then an array of PrescribedMotion objects is returned. If the property argument is given, that property value for each boundary prescribed motion is returned in the array instead of a PrescribedMotion object

    Arguments

  • Model (Model)

    Model to get boundary prescribed motions from

  • property (optional) (string)

    Name for property to get for all boundary prescribed motions in the model

    Returns

    Array of PrescribedMotion objects or properties

    Return type

    Array

    Example

    To make an array of PrescribedMotion objects for all of the boundary prescribed motions in model m:

    var a = PrescribedMotion.GetAll(m);

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

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


    GetComments()

    Description

    Extracts the comments associated to a boundary prescribed motion.

    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 boundary prescribed motion b:

    var comm_array = b.GetComments();


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

    Description

    Returns an array of PrescribedMotion objects for all of the flagged boundary prescribed motions in a model in PRIMER If the optional property argument is not given then an array of PrescribedMotion objects is returned. If the property argument is given, then that property value for each boundary prescribed motion is returned in the array instead of a PrescribedMotion object

    Arguments

  • Model (Model)

    Model to get boundary prescribed motions from

  • flag (Flag)

    Flag set on the boundary prescribed motions that you want to retrieve

  • property (optional) (string)

    Name for property to get for all flagged boundary prescribed motions in the model

    Returns

    Array of PrescribedMotion objects or properties

    Return type

    Array

    Example

    To make an array of PrescribedMotion objects for all of the boundary prescribed motions in model m flagged with f:

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

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

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


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

    Description

    Returns the PrescribedMotion object for a boundary prescribed motion ID.

    Arguments

  • Model (Model)

    Model to find the boundary prescribed motion in

  • number (integer)

    number of the boundary prescribed motion you want the PrescribedMotion object for

    Returns

    PrescribedMotion object (or null if boundary prescribed motion does not exist).

    Return type

    PrescribedMotion

    Example

    To get the PrescribedMotion object for boundary prescribed motion 100 in model m

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


    GetParameter(prop[string])

    Description

    Checks if a PrescribedMotion 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 PrescribedMotion.ViewParameters() method and 'method chaining' (see the examples below).

    Arguments

  • prop (string)

    boundary prescribed motion property to get parameter for

    Returns

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

    Return type

    Parameter

    Example

    To check if PrescribedMotion 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 PrescribedMotion property b.example is a parameter by using the GetParameter method:

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


    Keyword()

    Description

    Returns the keyword for this PrescribedMotion (*BOUNDARY_PRESCRIBED_MOTION_xxxx). Note that a carriage return is not added. See also PrescribedMotion.KeywordCards()

    Arguments

    No arguments

    Returns

    string containing the keyword.

    Return type

    String

    Example

    To get the keyword for PrescribedMotion pm:

    var key = pm.Keyword();


    KeywordCards()

    Description

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

    Arguments

    No arguments

    Returns

    string containing the cards.

    Return type

    String

    Example

    To get the cards for PrescribedMotion pm:

    var cards = pm.KeywordCards();


    Last(Model[Model]) [static]

    Description

    Returns the last boundary prescribed motion in the model.

    Arguments

  • Model (Model)

    Model to get last boundary prescribed motion in

    Returns

    PrescribedMotion object (or null if there are no boundary prescribed motions in the model).

    Return type

    PrescribedMotion

    Example

    To get the last boundary prescribed motion in model m:

    var b = PrescribedMotion.Last(m);


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

    Description

    Returns the last free boundary prescribed motion label in the model. Also see PrescribedMotion.FirstFreeLabel(), PrescribedMotion.NextFreeLabel() and see Model.LastFreeItemLabel()

    Arguments

  • Model (Model)

    Model to get last free boundary prescribed motion 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

    PrescribedMotion label.

    Return type

    Number

    Example

    To get the last free boundary prescribed motion label in model m:

    var label = PrescribedMotion.LastFreeLabel(m);


    Next()

    Description

    Returns the next boundary prescribed motion in the model.

    Arguments

    No arguments

    Returns

    PrescribedMotion object (or null if there are no more boundary prescribed motions in the model).

    Return type

    PrescribedMotion

    Example

    To get the boundary prescribed motion in model m after boundary prescribed motion b:

    var b = b.Next();


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

    Description

    Returns the next free (highest+1) boundary prescribed motion label in the model. Also see PrescribedMotion.FirstFreeLabel(), PrescribedMotion.LastFreeLabel() and Model.NextFreeItemLabel()

    Arguments

  • Model (Model)

    Model to get next free boundary prescribed motion 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

    PrescribedMotion label.

    Return type

    Number

    Example

    To get the next free boundary prescribed motion label in model m:

    var label = PrescribedMotion.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 boundary prescribed motion.

    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 boundary prescribed motions from that model can be picked. If the argument is a Flag then only boundary prescribed motions that are flagged with limit can be selected. If omitted, or null, any boundary prescribed motions 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

    PrescribedMotion object (or null if not picked)

    Return type

    PrescribedMotion

    Example

    To pick a boundary prescribed motion from model m giving the prompt 'Pick boundary prescribed motion from screen':

    var b = PrescribedMotion.Pick('Pick boundary prescribed motion from screen', m);


    Previous()

    Description

    Returns the previous boundary prescribed motion in the model.

    Arguments

    No arguments

    Returns

    PrescribedMotion object (or null if there are no more boundary prescribed motions in the model).

    Return type

    PrescribedMotion

    Example

    To get the boundary prescribed motion in model m before boundary prescribed motion b:

    var b = b.Previous();


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

    Description

    Renumbers all of the boundary prescribed motions in the model.

    Arguments

  • Model (Model)

    Model that all boundary prescribed motions will be renumbered in

  • start (integer)

    Start point for renumbering

    Returns

    No return value

    Example

    To renumber all of the boundary prescribed motions in model m, from 1000000:

    PrescribedMotion.RenumberAll(m, 1000000);


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

    Description

    Renumbers all of the flagged boundary prescribed motions in the model.

    Arguments

  • Model (Model)

    Model that all the flagged boundary prescribed motions will be renumbered in

  • flag (Flag)

    Flag set on the boundary prescribed motions that you want to renumber

  • start (integer)

    Start point for renumbering

    Returns

    No return value

    Example

    To renumber all of the boundary prescribed motions in model m flagged with f, from 1000000:

    PrescribedMotion.RenumberFlagged(m, f, 1000000);


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

    Description

    Allows the user to select boundary prescribed motions using standard PRIMER object menus.

    Arguments

  • flag (Flag)

    Flag to use when selecting boundary prescribed motions

  • prompt (string)

    Text to display as a prompt to the user

  • limit (optional) (Model or Flag)

    If the argument is a Model then only boundary prescribed motions from that model can be selected. If the argument is a Flag then only boundary prescribed motions that are flagged with limit can be selected (limit should be different to flag). If omitted, or null, any boundary prescribed motions 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 boundary prescribed motions selected or null if menu cancelled

    Return type

    Number

    Example

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

    PrescribedMotion.Select(f, 'Select boundary prescribed motions', m);

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

    PrescribedMotion.Select(f, 'Select boundary prescribed motions', l);


    SetFlag(flag[Flag])

    Description

    Sets a flag on the boundary prescribed motion.

    Arguments

  • flag (Flag)

    Flag to set on the boundary prescribed motion

    Returns

    No return value

    Example

    To set flag f for boundary prescribed motion b:

    b.SetFlag(f);


    Sketch(redraw (optional)[boolean])

    Description

    Sketches the boundary prescribed motion. The boundary prescribed motion will be sketched until you either call PrescribedMotion.Unsketch(), PrescribedMotion.UnsketchAll(), Model.UnsketchAll(), or delete the model

    Arguments

  • redraw (optional) (boolean)

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

    Returns

    No return value

    Example

    To sketch boundary prescribed motion b:

    b.Sketch();


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

    Description

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

    Arguments

  • Model (Model)

    Model that all the flagged boundary prescribed motions will be sketched in

  • flag (Flag)

    Flag set on the boundary prescribed motions that you want to sketch

  • redraw (optional) (boolean)

    If model should be redrawn or not after the boundary prescribed motions are sketched. If omitted redraw is true. If you want to sketch flagged boundary prescribed motions 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 boundary prescribed motions flagged with flag in model m:

    PrescribedMotion.SketchFlagged(m, flag);


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

    Description

    Returns the total number of boundary prescribed motions in the model.

    Arguments

  • Model (Model)

    Model to get total for

  • exists (optional) (boolean)

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

    Returns

    number of boundary prescribed motions

    Return type

    Number

    Example

    To get the total number of boundary prescribed motions in model m:

    var total = PrescribedMotion.Total(m);


    Unblank()

    Description

    Unblanks the boundary prescribed motion

    Arguments

    No arguments

    Returns

    No return value

    Example

    To unblank boundary prescribed motion b:

    b.Unblank();


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

    Description

    Unblanks all of the boundary prescribed motions in the model.

    Arguments

  • Model (Model)

    Model that all boundary prescribed motions 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 boundary prescribed motions in model m:

    PrescribedMotion.UnblankAll(m);


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

    Description

    Unblanks all of the flagged boundary prescribed motions in the model.

    Arguments

  • Model (Model)

    Model that the flagged boundary prescribed motions will be unblanked in

  • flag (Flag)

    Flag set on the boundary prescribed motions 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 boundary prescribed motions in model m flagged with f:

    PrescribedMotion.UnblankFlagged(m, f);


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

    Description

    Unsets a defined flag on all of the boundary prescribed motions in the model.

    Arguments

  • Model (Model)

    Model that the defined flag for all boundary prescribed motions will be unset in

  • flag (Flag)

    Flag to unset on the boundary prescribed motions

    Returns

    No return value

    Example

    To unset the flag f on all the boundary prescribed motions in model m:

    PrescribedMotion.UnflagAll(m, f);


    Unsketch(redraw (optional)[boolean])

    Description

    Unsketches the boundary prescribed motion.

    Arguments

  • redraw (optional) (boolean)

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

    Returns

    No return value

    Example

    To unsketch boundary prescribed motion b:

    b.Unsketch();


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

    Description

    Unsketches all boundary prescribed motions.

    Arguments

  • Model (Model)

    Model that all boundary prescribed motions will be unblanked in

  • redraw (optional) (boolean)

    If model should be redrawn or not after the boundary prescribed motions 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 boundary prescribed motions in model m:

    PrescribedMotion.UnsketchAll(m);


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

    Description

    Unsketches all flagged boundary prescribed motions in the model.

    Arguments

  • Model (Model)

    Model that all boundary prescribed motions will be unsketched in

  • flag (Flag)

    Flag set on the boundary prescribed motions that you want to unsketch

  • redraw (optional) (boolean)

    If model should be redrawn or not after the boundary prescribed motions 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 boundary prescribed motions flagged with flag in model m:

    PrescribedMotion.UnsketchAll(m, flag);


    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

    PrescribedMotion object.

    Return type

    PrescribedMotion

    Example

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

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


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

    Description

    Adds a warning for boundary prescribed motion. 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 boundary prescribed motion b:

    b.Warning("My custom warning");


    Xrefs()

    Description

    Returns the cross references for this boundary prescribed motion.

    Arguments

    No arguments

    Returns

    Xrefs object.

    Return type

    Xrefs

    Example

    To get the cross references for boundary prescribed motion b:

    var xrefs = b.Xrefs();


    toString()

    Description

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

    Arguments

    No arguments

    Returns

    string

    Return type

    String

    Example

    To get data for PrescribedMotion pm in keyword format

    var s = pm.toString();