Beam class

The Beam class gives you access to beam 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

Beam properties

Name Type Description
cid integer Coordinate system ID (_SCALAR)
cid integer Coordinate system ID at node 1 (_SCALR)
colour Colour The colour of the beam
d1 real Section parameter 1
d2 real Section parameter 2
d3 real Section parameter 3
d4 real Section parameter 4
d5 real Section parameter 5
d6 real Section parameter 6
dofn1 integer Active degree of freedom at node 1 (_SCALAR)
dofn2 integer Active degree of freedom at node 2 (_SCALAR)
dofns integer Active degrees of freedom at nodes 1 and 2 (_SCALR)
eid integer Beam number. Also see the label property which is an alternative name for this.
elbow logical If ELBOW option is set. Can be true or false
exists (read only) logical true if beam exists, false if referred to but not defined.
include integer The Include file number that the beam is in.
iner real Mass moment of inertia for beam
label integer Beam number. Also see the eid property which is an alternative name for this.
local integer Coordinate system option
mn integer Middle Node for elbow beam
model (read only) integer The Model number that the beam is in.
n1 integer Node number 1
n2 integer Node number 2
n3 integer Node number 3
nodes (read only) integer Number of nodes beam has
offset real If _OFFSET option is set. Can be true or false
orientation real If _ORIENTATION option is set. Can be true or false
parm1 real Thickness parameter 1
parm2 real Thickness parameter 2
parm3 real Thickness parameter 3
parm4 real Thickness parameter 4
parm5 real Thickness parameter 5
pid integer Part number
pid1 integer Part number 1 for spotweld beam
pid2 integer Part number 2 for spotweld beam
pid_opt logical If _PID option is set. Can be true or false
rr1 integer Rotational release code at node 1
rr2 integer Rotational release code at node 2
rt1 integer Translational release code at node 1
rt2 integer Translational release code at node 2
scalar logical If _SCALAR option is set. Can be true or false
scalr logical If _SCALR option is set. Can be true or false
section logical If _SECTION option is set. Can be true or false
sn1 integer Scalar Node number 1
sn2 integer Scalar Node number 2
stype string Section type
thickness logical If _THICKNESS option is set. Can be true or false
transparency integer The transparency of the beam (0-100) 0% is opaque, 100% is transparent.
vol real Volume of beam
vx real Orientation vector X at node 1
vy real Orientation vector Y at node 1
vz real Orientation vector Z at node 1
warpage logical If WARPAGE option is set. Can be true or false
wx1 real Offset vector X at node 1
wx2 real Offset vector X at node 2
wy1 real Offset vector Y at node 1
wy2 real Offset vector Y at node 2
wz1 real Offset vector Z at node 1
wz2 real Offset vector Z at node 2

Detailed Description

The Beam class allows you to create, modify, edit and manipulate beam cards. See the documentation below for more details.

Constructor

new Beam(Model[Model], eid[integer], pid[integer], n1[integer], n2 (optional)[integer], n3 (optional)[integer])

Description

Create a new Beam object. Use either 1, 2 or 3 nodes when creating a new beam.

Arguments

  • Model (Model)

    Model that beam will be created in

  • eid (integer)

    Beam number

  • pid (integer)

    Part number

  • n1 (integer)

    Node number 1

  • n2 (optional) (integer)

    Node number 2

  • n3 (optional) (integer)

    Node number 3

    Returns

    Beam object

    Return type

    Beam

    Example

    To create a new beam in model m with label 100, part 10 and nodes 1, 2, 3:

    var b = new Beam(m, 100, 10, 1, 2, 3);

    Details of functions

    AssociateComment(Comment[Comment])

    Description

    Associates a comment with a beam.

    Arguments

  • Comment (Comment)

    Comment that will be attached to the beam

    Returns

    No return value

    Example

    To associate comment c to the beam b:

    b.AssociateComment(c);


    Blank()

    Description

    Blanks the beam

    Arguments

    No arguments

    Returns

    No return value

    Example

    To blank beam b:

    b.Blank();


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

    Description

    Blanks all of the beams in the model.

    Arguments

  • Model (Model)

    Model that all beams 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 beams in model m:

    Beam.BlankAll(m);


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

    Description

    Blanks all of the flagged beams in the model.

    Arguments

  • Model (Model)

    Model that all the flagged beams will be blanked in

  • flag (Flag)

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

    Beam.BlankFlagged(m, f);


    Blanked()

    Description

    Checks if the beam is blanked or not.

    Arguments

    No arguments

    Returns

    true if blanked, false if not.

    Return type

    Boolean

    Example

    To check if beam b is blanked:

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


    Browse(modal (optional)[boolean])

    Description

    Starts an edit panel in Browse mode.

    Arguments

  • modal (optional) (boolean)

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

    Returns

    no return value

    Example

    To Browse beam b:

    b.Browse();


    ClearFlag(flag[Flag])

    Description

    Clears a flag on the beam.

    Arguments

  • flag (Flag)

    Flag to clear on the beam

    Returns

    No return value

    Example

    To clear flag f for beam b:

    b.ClearFlag(f);


    Copy(range (optional)[boolean])

    Description

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

    Beam object

    Return type

    Beam

    Example

    To copy beam b into beam z:

    var z = b.Copy();


    Create(Model[Model], modal (optional)[boolean]) [static]

    Description

    Starts an interactive editing panel to create a beam

    Arguments

  • Model (Model)

    Model that the beam will be created in.

  • modal (optional) (boolean)

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

    Returns

    Beam object (or null if not made).

    Return type

    Beam

    Example

    To start creating a beam in model m:

    var b = Beam.Create(m);


    DetachComment(Comment[Comment])

    Description

    Detaches a comment from a beam.

    Arguments

  • Comment (Comment)

    Comment that will be detached from the beam

    Returns

    No return value

    Example

    To detach comment c from the beam b:

    b.DetachComment(c);


    Edit(modal (optional)[boolean])

    Description

    Starts an interactive editing panel.

    Arguments

  • modal (optional) (boolean)

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

    Returns

    no return value

    Example

    To Edit beam b:

    b.Edit();


    ElemCut(Database cross section label[integer])

    Description

    Returns coordinates of the intersections between a beam and a database cross section.
    Note this function does not check that the beam is in the cross section definition (part set)

    Arguments

  • Database cross section label (integer)

    The label of the database cross section.

    Returns

    An array containing the x,y,z coordinates of the cut point, or NULL if it does not cut

    Return type

    Array

    Example

    To get the cut line coordinates between database cross section 200 and beam b:

    var data = b.ElemCut(200)


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

    Description

    Adds an error for beam. 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 beam b:

    b.Error("My custom error");


    ExtractColour()

    Description

    Extracts the actual colour used for beam.
    By default in PRIMER many entities such as elements get their colour automatically from the part that they are in. PRIMER cycles through 13 default colours based on the label of the entity. In this case the beam colour property will return the value Colour.PART instead of the actual colour. This method will return the actual colour which is used for drawing the beam.

    Arguments

    No arguments

    Returns

    colour value (integer)

    Return type

    Number

    Example

    To return the colour used for drawing beam b:

    var colour = b.ExtractColour();


    FindBeamInBox(Model[Model], xmin[real], xmax[real], ymin[real], ymax[real], zmin[real], zmax[real], flag (optional)[integer], excl (optional)[integer], vis_only (optional)[integer]) [static]

    Description

    Returns an array of Beam objects for the beams within a box. Please note this function provides a list of all beams that could potentially be in the box (using computationally cheap bounding box comparison) it is not a rigorous test of whether the beam is actually in the box. Note an extension of "spot_thickness" is applied to each beam. This may include beams that are ostensibly outside box. The user should apply their own test. (this function is intended to provide an upper bound of elems to test) Setting the "excl" flag will require that the beam is fully contained, but this may not capture all the beams you want to process.

    Arguments

  • Model (Model)

    Model designated model

  • xmin (real)

    Minimum bound in global x

  • xmax (real)

    Maximum bound in global x

  • ymin (real)

    Minimum bound in global y

  • ymax (real)

    Maximum bound in global y

  • zmin (real)

    Minimum bound in global z

  • zmax (real)

    Maximum bound in global z

  • flag (optional) (integer)

    Optional flag to restrict beams considered, if 0 all beams considered

  • excl (optional) (integer)

    Optional flag ( 0) Apply inclusive selection ( 1) Apply exclusive selection inclusive selection means elements intersect box exclusive selection means elements contained in box

  • vis_only (optional) (integer)

    Optional flag to consider visible elements only (1), if (0) all elements considered

    Returns

    Array of Beam objects

    Return type

    Array

    Example

    To get an array of Beam objects for flagged beams within defined box (inclusive selection)

          var s = Beam.FindBeamInBox(m, xmin, xmax, ymin, ymax, zmin, zmax, flag, 0, 0);
          if(s.length) ...
          


    FindBeamInit(Model[Model], flag (optional)[Flag]) [static]  [deprecated]

    This function is deprecated in version 20.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.

    Description

    Initialize setup so that all flagged beams in model can be tested to see if they are within box. In v20.0 this function is obsolete and the flagging bit (if required) should be specified in Beam.FindBeamInBox()

    Arguments

  • Model (Model)

    Model in which beams have been flagged

  • flag (optional) (Flag)

    Optional flag that has been set on the beams, if 0 all beams considered

    Returns

    No return value

    Example

    To initialize find setup for flagged beams in model m:

    Beam.FindBeamInit(m, flag);


    First(Model[Model]) [static]

    Description

    Returns the first beam in the model.

    Arguments

  • Model (Model)

    Model to get first beam in

    Returns

    Beam object (or null if there are no beams in the model).

    Return type

    Beam

    Example

    To get the first beam in model m:

    var b = Beam.First(m);


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

    Description

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

    Arguments

  • Model (Model)

    Model to get first free beam 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

    Beam label.

    Return type

    Number

    Example

    To get the first free beam label in model m:

    var label = Beam.FirstFreeLabel(m);


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

    Description

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

    Arguments

  • Model (Model)

    Model that all beams will be flagged in

  • flag (Flag)

    Flag to set on the beams

    Returns

    No return value

    Example

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

    Beam.FlagAll(m, f);


    Flagged(flag[Flag])

    Description

    Checks if the beam is flagged or not.

    Arguments

  • flag (Flag)

    Flag to test on the beam

    Returns

    true if flagged, false if not.

    Return type

    Boolean

    Example

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

    Arguments

  • Model (Model)

    Model that all beams are in

  • func (function)

    Function to call for each beam

  • 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 beams in model m:

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

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

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


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

    Description

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

    Arguments

  • Model (Model)

    Model to get beams from

  • property (optional) (string)

    Name for property to get for all beams in the model

    Returns

    Array of Beam objects or properties

    Return type

    Array

    Example

    To make an array of Beam objects for all of the beams in model m:

    var a = Beam.GetAll(m);

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

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


    GetComments()

    Description

    Extracts the comments associated to a beam.

    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 beam b:

    var comm_array = b.GetComments();


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

    Description

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

    Arguments

  • Model (Model)

    Model to get beams from

  • flag (Flag)

    Flag set on the beams that you want to retrieve

  • property (optional) (string)

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

    Returns

    Array of Beam objects or properties

    Return type

    Array

    Example

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

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

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

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


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

    Description

    Returns the Beam object for a beam ID.

    Arguments

  • Model (Model)

    Model to find the beam in

  • number (integer)

    number of the beam you want the Beam object for

    Returns

    Beam object (or null if beam does not exist).

    Return type

    Beam

    Example

    To get the Beam object for beam 100 in model m

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


    GetParameter(prop[string])

    Description

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

    Arguments

  • prop (string)

    beam property to get parameter for

    Returns

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

    Return type

    Parameter

    Example

    To check if Beam 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 Beam 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 beam (*BEAM, *BEAM_SCALAR or *BEAM_SCALAR_VALUE). Note that a carriage return is not added. See also Beam.KeywordCards()

    Arguments

    No arguments

    Returns

    string containing the keyword.

    Return type

    String

    Example

    To get the keyword for beam s:

    var key = s.Keyword();


    KeywordCards()

    Description

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

    Arguments

    No arguments

    Returns

    string containing the cards.

    Return type

    String

    Example

    To get the cards for beam b:

    var cards = b.KeywordCards();


    Last(Model[Model]) [static]

    Description

    Returns the last beam in the model.

    Arguments

  • Model (Model)

    Model to get last beam in

    Returns

    Beam object (or null if there are no beams in the model).

    Return type

    Beam

    Example

    To get the last beam in model m:

    var b = Beam.Last(m);


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

    Description

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

    Arguments

  • Model (Model)

    Model to get last free beam 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

    Beam label.

    Return type

    Number

    Example

    To get the last free beam label in model m:

    var label = Beam.LastFreeLabel(m);


    Next()

    Description

    Returns the next beam in the model.

    Arguments

    No arguments

    Returns

    Beam object (or null if there are no more beams in the model).

    Return type

    Beam

    Example

    To get the beam in model m after beam b:

    var b = b.Next();


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

    Description

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

    Arguments

  • Model (Model)

    Model to get next free beam 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

    Beam label.

    Return type

    Number

    Example

    To get the next free beam label in model m:

    var label = Beam.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 beam.

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

    Beam object (or null if not picked)

    Return type

    Beam

    Example

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

    var b = Beam.Pick('Pick beam from screen', m);


    Previous()

    Description

    Returns the previous beam in the model.

    Arguments

    No arguments

    Returns

    Beam object (or null if there are no more beams in the model).

    Return type

    Beam

    Example

    To get the beam in model m before beam b:

    var b = b.Previous();


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

    Description

    Renumbers all of the beams in the model.

    Arguments

  • Model (Model)

    Model that all beams will be renumbered in

  • start (integer)

    Start point for renumbering

    Returns

    No return value

    Example

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

    Beam.RenumberAll(m, 1000000);


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

    Description

    Renumbers all of the flagged beams in the model.

    Arguments

  • Model (Model)

    Model that all the flagged beams will be renumbered in

  • flag (Flag)

    Flag set on the beams that you want to renumber

  • start (integer)

    Start point for renumbering

    Returns

    No return value

    Example

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

    Beam.RenumberFlagged(m, f, 1000000);


    SectionFacePoints(face[integer])

    Description

    Returns the indices of the points for a faces to plot the true section of the beam. Note face numbers start at 0. Beam.SectionPoints must be called before this method.

    Arguments

  • face (integer)

    Face to get indices for

    Returns

    Array of integers

    Return type

    Number

    Example

    To get the indices of the points for the second face on beam b:

    var indices = b.SectionFacePoints(1);


    SectionFaces()

    Description

    Returns the number of faces to plot the true section of the beam. Beam.SectionPoints must be called before this method.

    Arguments

    No arguments

    Returns

    integer

    Return type

    Number

    Example

    To get the number of faces for beam b:

    var faces = b.SectionFaces();


    SectionPoints()

    Description

    Returns the point coordinates to plot the true section of the beam. They are returned in a single array of numbers.

    Arguments

    No arguments

    Returns

    Array of reals

    Return type

    Number

    Example

    To get the point coordinates for beam b:

    var points = b.SectionPoints();


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

    Description

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

    Arguments

  • flag (Flag)

    Flag to use when selecting beams

  • prompt (string)

    Text to display as a prompt to the user

  • limit (optional) (Model or Flag)

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

    Return type

    Number

    Example

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

    Beam.Select(f, 'Select beams', m);

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

    Beam.Select(f, 'Select beams', l);


    SetFlag(flag[Flag])

    Description

    Sets a flag on the beam.

    Arguments

  • flag (Flag)

    Flag to set on the beam

    Returns

    No return value

    Example

    To set flag f for beam b:

    b.SetFlag(f);


    Sketch(redraw (optional)[boolean])

    Description

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

    Arguments

  • redraw (optional) (boolean)

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

    Returns

    No return value

    Example

    To sketch beam b:

    b.Sketch();


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

    Description

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

    Arguments

  • Model (Model)

    Model that all the flagged beams will be sketched in

  • flag (Flag)

    Flag set on the beams that you want to sketch

  • redraw (optional) (boolean)

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

    Beam.SketchFlagged(m, flag);


    TiedNodeCheck(Contact label[integer], Flag[Flag], Option1[integer], Option2[integer])

    Description

    Checks if nodes of beam are tied by contact or directly attached (non-zero option1)

    Arguments

  • Contact label (integer)

    The label of the tied contact. If zero the tied contact is found for the beam by reverse lookup.

  • Flag (Flag)

    flag bit

  • Option1 (integer)

    Directly tied node (logical OR) 0:NONE 1:NRB/C_EXNO 2:BEAM 4:SHELL 8:SOLID 16:TSHELL

  • Option2 (integer)

    0:No action 1:report error if directly attached node (acc. option1) also captured by contact

    Returns

    string

    Return type

    String

    Example

    To check if both nodes of beam b are tied by contact 200 or attach directly to constraint, beam or shell:

    var message = b.TiedNodeCheck(200, flag, 1|2|4, 1)


    Timestep()

    Description

    Calculates the timestep for the beam

    Arguments

    No arguments

    Returns

    real

    Return type

    Number

    Example

    To calculate the timestep for beam b:

    var timestep = b.Timestep();


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

    Description

    Returns the total number of beams in the model.

    Arguments

  • Model (Model)

    Model to get total for

  • exists (optional) (boolean)

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

    Returns

    number of beams

    Return type

    Number

    Example

    To get the total number of beams in model m:

    var total = Beam.Total(m);


    Unblank()

    Description

    Unblanks the beam

    Arguments

    No arguments

    Returns

    No return value

    Example

    To unblank beam b:

    b.Unblank();


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

    Description

    Unblanks all of the beams in the model.

    Arguments

  • Model (Model)

    Model that all beams 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 beams in model m:

    Beam.UnblankAll(m);


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

    Description

    Unblanks all of the flagged beams in the model.

    Arguments

  • Model (Model)

    Model that the flagged beams will be unblanked in

  • flag (Flag)

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

    Beam.UnblankFlagged(m, f);


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

    Description

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

    Arguments

  • Model (Model)

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

  • flag (Flag)

    Flag to unset on the beams

    Returns

    No return value

    Example

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

    Beam.UnflagAll(m, f);


    Unsketch(redraw (optional)[boolean])

    Description

    Unsketches the beam.

    Arguments

  • redraw (optional) (boolean)

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

    Returns

    No return value

    Example

    To unsketch beam b:

    b.Unsketch();


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

    Description

    Unsketches all beams.

    Arguments

  • Model (Model)

    Model that all beams will be unblanked in

  • redraw (optional) (boolean)

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

    Beam.UnsketchAll(m);


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

    Description

    Unsketches all flagged beams in the model.

    Arguments

  • Model (Model)

    Model that all beams will be unsketched in

  • flag (Flag)

    Flag set on the beams that you want to unsketch

  • redraw (optional) (boolean)

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

    Beam.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

    Beam object.

    Return type

    Beam

    Example

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

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


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

    Description

    Adds a warning for beam. 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 beam b:

    b.Warning("My custom warning");


    Xrefs()

    Description

    Returns the cross references for this beam.

    Arguments

    No arguments

    Returns

    Xrefs object.

    Return type

    Xrefs

    Example

    To get the cross references for beam b:

    var xrefs = b.Xrefs();


    toString()

    Description

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

    Arguments

    No arguments

    Returns

    string

    Return type

    String

    Example

    To get data for beam b in keyword format

    var str = b.toString();