Section class

The Section class gives you access to section 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

Section constants

Name Description
Section.ALE1D Section ale1d type
Section.ALE2D Section ale2d type
Section.BEAM Section beam type
Section.DISCRETE Section discrete type
Section.IGA_SHELL Section IGA shell type
Section.IGA_SOLID Section IGA solid type
Section.POINT_SOURCE Section point source type
Section.SEATBELT Section seatbelt type
Section.SHELL Section shell type
Section.SOLID Section solid type
Section.SPH Section sph type
Section.TSHELL Section thick shell type

Section properties

Name Type Description
aafac real ALE advection factor(SHELL, SOLID)
aet integer Ambient element type (ALE1D, ALE2D, SOLID)
afac real Smoothing weight factor - Simple average (SHELL, SOLID)
ale logical If _ALE option is set. Can be true or false (SHELL, SOLID)
aleform integer ALE formulation (ALE1D, ALE2D)
baselm integer Base element type for XFEM (SHELL)
bfac real Smoothing weight factor - Volume weighting (SHELL, SOLID)
cfac real Smoothing weight factor - Isoparametric (SHELL, SOLID)
cmid integer Cohesive material (SHELL, SOLID)
cohthk real Cohesive thickness (SOLID)
colour Colour The colour of the section
dfac real Smoothing weight factor - Equipotential (SHELL, SOLID)
domint integer Domain integration in XFEM (SHELL)
dr real PERI normalized horizon size (SOLID)
dx real Normalized dilation parameter of kernel function in X (SHELL, SOLID)
dy real Normalized dilation parameter of kernel function in Y (SHELL, SOLID)
dz real Normalized dilation parameter of kernel function in Z (SOLID)
efac real Smoothing weight factor - Equilibrium (SHELL)
efg logical If _EFG option is set. Can be true or false (SHELL, SOLID)
elform integer Element formulation (ALE1D, ALE2D, BEAM, IGA_SHELL, IGA_SOLID, SHELL, SOLID, TSHELL)
end real End time for smoothing (SHELL, SOLID)
exists (read only) logical true if section exists, false if referred to but not defined.
failcr integer Different failure criteria (SHELL)
fs real SPG Failure strain if IDAM = 1 (SOLID)
icomp integer Composite flag (IGA_SHELL, IGA_SOLID, SHELL, TSHELL)
idam integer SPG Option of damage mechanism (SOLID)
idila integer Normalized dilation parameter definition (SOLID)
idim integer Domain integration method (SOLID)
iebt integer Essential boundary condition treatment (SOLID)
ihgf integer Flag for using hourglass stabilization (SHELL, SOLID)
iloc integer Coordinate system option (SHELL)
include integer The Include file number that the section is in.
ispline integer EFG kernel function definition (SHELL, SOLID)
itaj integer Flag for setting up finite element matrices (SHELL, SOLID)
itb integer SPG Stabilization flag (SOLID)
ithelfm integer THERMAL shell formulation (SHELL)
iunf integer Flag for using nodal fibre vectors (SHELL)
kernel integer SPG kernel type approximation (SOLID)
label integer or string Section ID (all types) or character label. Also see the secid property which is an alternative name for this.
lmc integer Number of property parameters (SHELL, SOLID)
lprint integer Debug printout option (SHELL)
lscale real SPG length scale for displacement regularisation (SOLID)
misc logical If _MISC option is set. Can be true or false (SHELL, SOLID)
model (read only) integer The Model number that the section is in.
nhsv integer Number of history variables (SHELL, SOLID)
nip integer Number of integration points (IGA_SHELL, IGA_SOLID, SHELL, SOLID, TSHELL)
nipp integer Number of in-plane integration points (SHELL)
nxdof integer Number of extra degrees of freedom per node (SHELL, SOLID)
peri logical If _PERI option is set. Can be true or false (SOLID)
propcr integer Not used (SHELL)
propt real Printout option (SHELL, TSHELL)
ptype integer PERI peridynamics formulation (SOLID)
qr real Quadrature rule (BEAM, IGA_SHELL, IGA_SOLID, SHELL, TSHELL)
secid integer or string Section ID (all types) or character label. Also see the label property which is an alternative name for this.
shrf real Shear correction factor (BEAM, IGA_SHELL, IGA_SOLID, SHELL, TSHELL)
smstep integer SPG Interval of timestep to conduction displ regularisation (SOLID)
spg logical If _SPG option is set. Can be true or false (SOLID)
start real Time imposed SPH approximation is activated (SPH) or
Start time for smoothing (SHELL, SOLID)
stretch real SPG stretching parameter if IDAM = 1 (SOLID)
swtime real SPG Time to switch from updated Lagrangian to Eulerian kernel (SOLID)
thermal logical If _THERMAL option is set. Can be true or false (SHELL)
thick real Thickness (ALE1D, SEATBELT)
title string Section title (all types)
toldef real Deformation tolerance (SOLID)
transparency integer The transparency of the section (0-100) 0% is opaque, 100% is transparent.
type (read only) constant Section type. Can be Section.ALE1D, Section.ALE2D, Section.BEAM, Section.DISCRETE, Section.IGA_SHELL, Section.IGA_SOLID, Section.POINT_SOURCE, Section.SEATBELT, Section.SHELL, Section.SOLID, Section.SPH or Section.TSHELL
xfem logical If _THERMAL option is set. Can be true or false (SHELL)

Properties for BEAM

Name Type Description
a real Cross sectional area
aisc logical If _AISC option is set. Can be true or false
aisc_label string AISC section label
ca real Cable area
cid integer Coordinate system ID for orientation
cst real Cross section type
d1 real Input parameter 1 for section type
d2 real Input parameter 2 for section type
d3 real Input parameter 3 for section type
d4 real Input parameter 4 for section type
d5 real Input parameter 5 for section type
d6 real Input parameter 6 for section type
dofn1 real Active degree of freedom at node 1
dofn2 real Active degree of freedom at node 2
iner real Mass moment of inertia
iovpr integer Print flag for the elbow ovalization degrees of freedom (elform 14)
iprstr integer Flag for adding stress due to pressure into the material routine (elform 14)
irr real Irr
iss real Iss
ist real Ist
itoff real Option to specify torsional behaviour for spotwelds
itorm real Itorm
itt real Itt
iw real Warping constant
iwr real Warping constant
iyr real IYR integral
izr real IZR integral
j real torsional constant
nsloc real Location of s reference surface
nsm real Non structural mass per unit length
ntloc real Location of t reference surface
offset real Offset for cable
pr real Pressure inside elements (elform 14)
print real Output spot force resultants from spotwelds
rampt real Ramp up time for dynamic relaxation
rrcon real r rotational constraint
sa real Shear area
scoor real Location of triad for discrete beam
srcon real s rotational constraint
stress real Initial stress for dynamic relaxation
stype string Section type
trcon real t rotational constraint
ts1 real s thickness or outer diameter at N1
ts2 real s thickness or outer diameter at N2
tt1 real t thickness or inner diameter at N1
tt2 real t thickness or inner diameter at N2
vol real Volume of discrete beam
ys real s coordinate of shear centre of cross section
zs real t coordinate of shear centre of cross section

Properties for DISCRETE

Name Type Description
cdl real Deflection limit in compression
cl real Clearance
dro integer Displacement/rotation option
fd real Failure deflection
kd real Dynamic magnification factor
tdl real Deflection limit in tension
v0 real Test velocity

Properties for IGA_SHELL

Name Type Description
irl integer Lamina integration rule
nloc real Location of reference surface
t real Shell thickness

Properties for IGA_SOLID

Name Type Description
ir integer Integration rule

Properties for POINT SOURCE

Name Type Description
lcidt integer Temperature loadcurve ID
lcidvel integer Inlet flow velocity loadcurve ID
lcidvolr integer Relative volume loadcurve ID
lcmdot1 integer Mass flowrate loadcurve for gas 1
lcmdot2 integer Mass flowrate loadcurve for gas 2
lcmdot3 integer Mass flowrate loadcurve for gas 3
lcmdot4 integer Mass flowrate loadcurve for gas 4
lcmdot5 integer Mass flowrate loadcurve for gas 5
lcmdot6 integer Mass flowrate loadcurve for gas 6
lcmdot7 integer Mass flowrate loadcurve for gas 7
lcmdot8 integer Mass flowrate loadcurve for gas 8
mixture logical If _MIXTURE option is set. Can be true or false
nidlc001 integer 1st node ID defining a local coordinate
nidlc002 integer 2nd node ID defining a local coordinate
nidlc003 integer 3rd node ID defining a local coordinate
points integer Number of point sources

Properties for SEATBELT

Name Type Description
area real Optional cross sectional area used in contact

Properties for SHELL

Name Type Description
edgset integer Edge node set
idof real Thickness field value
marea real Non structural mass per unit area
nloc integer Location of reference surface
setyp integer 2D solid element type
t1 real Thickness at Node 1
t2 real Thickness at Node 2
t3 real Thickness at Node 3
t4 real Thickness at Node 4

Properties for SOLID

Name Type Description
cohoff real Relative location of cohesive layer (for cohesive solid elements 20 and 22)
ds real Displacement jump
ecut real Minimum distance to the node that a crack surface can cut to the edge
gaskett real Gasket thickness for converting elform 19-22 elements to gasket element
ibr integer Branching
iken integer approximation
ips integer Pressure smoothing/recovery
sf real Failure strain
stime real Time to switch from stabilized EFG to standard EFG formulation

Properties for SPH

Name Type Description
cslh real Smoothing length constant
death real Time imposed SPH approximation is stopped
ellipse logical If _ELLIPSE option is set (was _TENSOR pre R8). Can be true or false
hmax real Max smoothing length scale factor
hmin real Min smoothing length scale factor
hxcslh real Constant for smoothing length in X for tensor/ellipse case
hxini real Initial smoothing length in X for tensor/ellipse case
hycslh real Constant for smoothing length in Y for tensor/ellipse case
hyini real Initial smoothing length in Y for tensor/ellipse case
hzcslh real Constant for smoothing length in Z for tensor/ellipse case
hzini real Initial smoothing length in Z for tensor/ellipse case
iform integer SPH element formulation
interaction logical If _INTERACTION option is set. Can be true or false
sphini real Optional initial smoothing length
tensor logical If _TENSOR option is set (_ELLIPSE from R8 onwards). Can be true or false
user logical If _USER option is set. Can be true or false

Properties for TSHELL

Name Type Description
tshear integer Flag for transverse shear strain or stress distribution

Detailed Description

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

Constructor

new Section(Model[Model], secid[integer or string], type[constant], title (optional)[string])

Description

Create a new Section object.

Arguments

  • Model (Model)

    Model that section will be created in

  • secid (integer or string)

    Section number or character label

  • type (constant)

    Section type. Can be Section.BEAM, Section.DISCRETE, Section.IGA_SHELL, Section.IGA_SOLID, Section.POINT_SOURCE, Section.SEATBELT, Section.SHELL, Section.SOLID, Section.SPH or Section.TSHELL

  • title (optional) (string)

    Title for the section

    Returns

    Section object

    Return type

    Section

    Example

    To create a new section, type shell, called 'Example' in model m with label 100:

    var s = new Section(m, 100, Section.SHELL, 'Example');

    Details of functions

    AssociateComment(Comment[Comment])

    Description

    Associates a comment with a section.

    Arguments

  • Comment (Comment)

    Comment that will be attached to the section

    Returns

    No return value

    Example

    To associate comment c to the section s:

    s.AssociateComment(c);


    Blank()

    Description

    Blanks the section

    Arguments

    No arguments

    Returns

    No return value

    Example

    To blank section s:

    s.Blank();


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

    Description

    Blanks all of the sections in the model.

    Arguments

  • Model (Model)

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

    Section.BlankAll(m);


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

    Description

    Blanks all of the flagged sections in the model.

    Arguments

  • Model (Model)

    Model that all the flagged sections will be blanked in

  • flag (Flag)

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

    Section.BlankFlagged(m, f);


    Blanked()

    Description

    Checks if the section is blanked or not.

    Arguments

    No arguments

    Returns

    true if blanked, false if not.

    Return type

    Boolean

    Example

    To check if section s is blanked:

    if (s.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 section s:

    s.Browse();


    ClearFlag(flag[Flag])

    Description

    Clears a flag on the section.

    Arguments

  • flag (Flag)

    Flag to clear on the section

    Returns

    No return value

    Example

    To clear flag f for section s:

    s.ClearFlag(f);


    Copy(range (optional)[boolean])

    Description

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

    Section object

    Return type

    Section

    Example

    To copy section s into section z:

    var z = s.Copy();


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

    Description

    Starts an interactive editing panel to create a section

    Arguments

  • Model (Model)

    Model that the section 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

    Section object (or null if not made).

    Return type

    Section

    Example

    To start creating a section in model m:

    var s = Section.Create(m);


    DetachComment(Comment[Comment])

    Description

    Detaches a comment from a section.

    Arguments

  • Comment (Comment)

    Comment that will be detached from the section

    Returns

    No return value

    Example

    To detach comment c from the section s:

    s.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 section s:

    s.Edit();


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

    Description

    Adds an error for section. 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 section s:

    s.Error("My custom error");


    ExtractColour()

    Description

    Extracts the actual colour used for section.
    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 section 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 section.

    Arguments

    No arguments

    Returns

    colour value (integer)

    Return type

    Number

    Example

    To return the colour used for drawing section s:

    var colour = s.ExtractColour();


    First(Model[Model]) [static]

    Description

    Returns the first section in the model.

    Arguments

  • Model (Model)

    Model to get first section in

    Returns

    Section object (or null if there are no sections in the model).

    Return type

    Section

    Example

    To get the first section in model m:

    var s = Section.First(m);


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

    Description

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

    Arguments

  • Model (Model)

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

    Section label.

    Return type

    Number

    Example

    To get the first free section label in model m:

    var label = Section.FirstFreeLabel(m);


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

    Description

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

    Arguments

  • Model (Model)

    Model that all sections will be flagged in

  • flag (Flag)

    Flag to set on the sections

    Returns

    No return value

    Example

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

    Section.FlagAll(m, f);


    Flagged(flag[Flag])

    Description

    Checks if the section is flagged or not.

    Arguments

  • flag (Flag)

    Flag to test on the section

    Returns

    true if flagged, false if not.

    Return type

    Boolean

    Example

    To check if section s has flag f set on it:

    if (s.Flagged(f) ) do_something...


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

    Description

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

    Arguments

  • Model (Model)

    Model that all sections are in

  • func (function)

    Function to call for each section

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

    Section.ForEach(m, test);
    function test(s)
    {
    // s is Section object
    }

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

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


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

    Description

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

    Arguments

  • Model (Model)

    Model to get sections from

  • property (optional) (string)

    Name for property to get for all sections in the model

    Returns

    Array of Section objects or properties

    Return type

    Array

    Example

    To make an array of Section objects for all of the sections in model m:

    var a = Section.GetAll(m);

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

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


    GetBetaData(ipt[integer])

    Description

    Returns the beta angle data for an integration point in *SECTION_IGA_SHELL, *SECTION_SHELL or *SECTION_TSHELL.

    Arguments

  • ipt (integer)

    The integration point you want the data for. Note that integration points start at 0, not 1.

    Returns

    real

    Return type

    Number

    Example

    To get the beta angle for the 3rd integration point for section shell s:

    if (s.icomp && s.nip >= 3)
    {
        var beta = s.GetBetaData(2);
    }


    GetComments()

    Description

    Extracts the comments associated to a section.

    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 section s:

    var comm_array = s.GetComments();


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

    Description

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

    Arguments

  • Model (Model)

    Model to get sections from

  • flag (Flag)

    Flag set on the sections that you want to retrieve

  • property (optional) (string)

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

    Returns

    Array of Section objects or properties

    Return type

    Array

    Example

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

    var s = Section.GetFlagged(m, f);

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

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


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

    Description

    Returns the Section object for a section ID.

    Arguments

  • Model (Model)

    Model to find the section in

  • number (integer)

    number of the section you want the Section object for

    Returns

    Section object (or null if section does not exist).

    Return type

    Section

    Example

    To get the Section object for section 100 in model m

    var s = Section.GetFromID(m, 100);


    GetLmcData(i[integer])

    Description

    Returns the LMC property parameter for *SECTION_SHELL or *SECTION_SOLID.

    Arguments

  • i (integer)

    The point you want the parameter for. Note that points start at 0, not 1.

    Returns

    real

    Return type

    Number

    Example

    To get the 3rd LMC parameter for section shell s:

    if (s.lmc >= 3)
    {
        var p = s.GetLmcData(2);
    }


    GetParameter(prop[string])

    Description

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

    Arguments

  • prop (string)

    section property to get parameter for

    Returns

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

    Return type

    Parameter

    Example

    To check if Section property s.example is a parameter:

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

    To check if Section property s.example is a parameter by using the GetParameter method:

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


    GetPointData(ipt[integer])

    Description

    Returns the point data for a single point in *SECTION_POINT_SOURCE.

    Arguments

  • ipt (integer)

    The point you want the data for. Note that integration points start at 0, not 1.

    Returns

    An array of numbers containing the node id, vector id and orifice area.

    Return type

    Number

    Example

    To get the data for the 3rd point for section point source s:

    if (s.points >= 3)
    {
        var pt_data = s.GetPointData(3);
    }


    GetUserData(ipt[integer])

    Description

    Returns the user defined data for an integration point in *SECTION_SHELL and *SECTION_SOLID.

    Arguments

  • ipt (integer)

    The integration point you want the data for. Note that integration points start at 0, not 1.

    Returns

    An array containing the data (XI, ETA, WGT for *SECTION_SHELL, XI, ETA, ZETA, WGT for *SECTION_SOLID).

    Return type

    Array

    Example

    To get the data for the 3rd integration point for section shell s:

    if (s.nipp >= 3)
    {
        var user_data = s.GetUserData(2);
    }


    Keyword()

    Description

    Returns the keyword for this section (*SECT, *SECT_SCALAR or *SECT_SCALAR_VALUE). Note that a carriage return is not added. See also Section.KeywordCards()

    Arguments

    No arguments

    Returns

    string containing the keyword.

    Return type

    String

    Example

    To get the keyword for section s:

    var key = s.Keyword();


    KeywordCards()

    Description

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

    Arguments

    No arguments

    Returns

    string containing the cards.

    Return type

    String

    Example

    To get the cards for section s:

    var cards = n.KeywordCards();


    Last(Model[Model]) [static]

    Description

    Returns the last section in the model.

    Arguments

  • Model (Model)

    Model to get last section in

    Returns

    Section object (or null if there are no sections in the model).

    Return type

    Section

    Example

    To get the last section in model m:

    var s = Section.Last(m);


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

    Description

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

    Arguments

  • Model (Model)

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

    Section label.

    Return type

    Number

    Example

    To get the last free section label in model m:

    var label = Section.LastFreeLabel(m);


    Next()

    Description

    Returns the next section in the model.

    Arguments

    No arguments

    Returns

    Section object (or null if there are no more sections in the model).

    Return type

    Section

    Example

    To get the section in model m after section s:

    var s = s.Next();


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

    Description

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

    Arguments

  • Model (Model)

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

    Section label.

    Return type

    Number

    Example

    To get the next free section label in model m:

    var label = Section.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 section.

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

    Section object (or null if not picked)

    Return type

    Section

    Example

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

    var s = Section.Pick('Pick section from screen', m);


    Previous()

    Description

    Returns the previous section in the model.

    Arguments

    No arguments

    Returns

    Section object (or null if there are no more sections in the model).

    Return type

    Section

    Example

    To get the section in model m before section s:

    var s = s.Previous();


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

    Description

    Renumbers all of the sections in the model.

    Arguments

  • Model (Model)

    Model that all sections will be renumbered in

  • start (integer)

    Start point for renumbering

    Returns

    No return value

    Example

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

    Section.RenumberAll(m, 1000000);


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

    Description

    Renumbers all of the flagged sections in the model.

    Arguments

  • Model (Model)

    Model that all the flagged sections will be renumbered in

  • flag (Flag)

    Flag set on the sections that you want to renumber

  • start (integer)

    Start point for renumbering

    Returns

    No return value

    Example

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

    Section.RenumberFlagged(m, f, 1000000);


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

    Description

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

    Arguments

  • flag (Flag)

    Flag to use when selecting sections

  • prompt (string)

    Text to display as a prompt to the user

  • limit (optional) (Model or Flag)

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

    Return type

    Number

    Example

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

    Section.Select(f, 'Select sections', m);

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

    Section.Select(f, 'Select sections', l);


    SetBetaData(ipt[integer], beta[real])

    Description

    Sets the beta angle for an integration point in *SECTION_IGA_SHELL, *SECTION_SHELL or *SECTION_TSHELL.

    Arguments

  • ipt (integer)

    The integration point you want to set the data for. Note that integration points start at 0, not 1.

  • beta (real)

    Beta angle for the integration point.

    Returns

    No return value.

    Example

    To set the beta angle for the 3rd integration point to 45, for section s:

    s.SetBetaData(2, 45);


    SetFlag(flag[Flag])

    Description

    Sets a flag on the section.

    Arguments

  • flag (Flag)

    Flag to set on the section

    Returns

    No return value

    Example

    To set flag f for section s:

    s.SetFlag(f);


    SetLmcData(ipt[integer], lmc[real])

    Description

    Sets the lmc parameter for a point in *SECTION_SHELL or *SECTION_SOLID.

    Arguments

  • ipt (integer)

    The point you want to set the data for. Note that points start at 0, not 1.

  • lmc (real)

    Lmc parameter for the point.

    Returns

    No return value.

    Example

    To set the 3rd lmc point to 0.1, for section s:

    s.SetLmcData(2, 0.1);


    SetPointData(ipt[integer], nodeid[integer], vecid[integer], area[real])

    Description

    Sets the data for a single point in *SECTION_POINT_SOURCE.

    Arguments

  • ipt (integer)

    The point you want to set the data for. Note that integration points start at 0, not 1.

  • nodeid (integer)

    Node ID for the point.

  • vecid (integer)

    Vector ID for the point.

  • area (real)

    Orifice area for the point.

    Returns

    No return value.

    Example

    To set the data for the 3rd point to node 1, vector 10 and area 0.2, for section s:

    s.SetPointData(2, 1, 10, 0.2);


    SetUserData(ipt[integer], xi[real], eta[real], zeta (SOLID) or
    wgt (SHELL)[real], wgt (SOLID only)[real])

    Description

    Sets the user defined data for an integration point in *SECTION_SHELL and *SECTION_SOLID.

    Arguments

  • ipt (integer)

    The integration point you want to set the data for. Note that integration points start at 0, not 1.

  • xi (real)

    First isoparametric coordinate.

  • eta (real)

    Second isoparametric coordinate.

  • zeta (SOLID) or
    wgt (SHELL)
    (real)

    Second isoparametric coordinate (SOLID) or
    Isoparametric weight (SHELL)

  • wgt (SOLID only) (real)

    Isoparametric weight (SOLID)

    Returns

    No return value.

    Example

    To set the user data for the 3rd integration point to xi 0.5, eta 0.5, zeta -0.5, wgt 0.125, for section solid s:

    s.SetUserData(2, 0.5, 0.5, -0.5, 0.125);


    Sketch(redraw (optional)[boolean])

    Description

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

    Arguments

  • redraw (optional) (boolean)

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

    Returns

    No return value

    Example

    To sketch section s:

    s.Sketch();


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

    Description

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

    Arguments

  • Model (Model)

    Model that all the flagged sections will be sketched in

  • flag (Flag)

    Flag set on the sections that you want to sketch

  • redraw (optional) (boolean)

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

    Section.SketchFlagged(m, flag);


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

    Description

    Returns the total number of sections in the model.

    Arguments

  • Model (Model)

    Model to get total for

  • exists (optional) (boolean)

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

    Returns

    number of sections

    Return type

    Number

    Example

    To get the total number of sections in model m:

    var total = Section.Total(m);


    Unblank()

    Description

    Unblanks the section

    Arguments

    No arguments

    Returns

    No return value

    Example

    To unblank section s:

    s.Unblank();


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

    Description

    Unblanks all of the sections in the model.

    Arguments

  • Model (Model)

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

    Section.UnblankAll(m);


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

    Description

    Unblanks all of the flagged sections in the model.

    Arguments

  • Model (Model)

    Model that the flagged sections will be unblanked in

  • flag (Flag)

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

    Section.UnblankFlagged(m, f);


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

    Description

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

    Arguments

  • Model (Model)

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

  • flag (Flag)

    Flag to unset on the sections

    Returns

    No return value

    Example

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

    Section.UnflagAll(m, f);


    Unsketch(redraw (optional)[boolean])

    Description

    Unsketches the section.

    Arguments

  • redraw (optional) (boolean)

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

    Returns

    No return value

    Example

    To unsketch section s:

    s.Unsketch();


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

    Description

    Unsketches all sections.

    Arguments

  • Model (Model)

    Model that all sections will be unblanked in

  • redraw (optional) (boolean)

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

    Section.UnsketchAll(m);


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

    Description

    Unsketches all flagged sections in the model.

    Arguments

  • Model (Model)

    Model that all sections will be unsketched in

  • flag (Flag)

    Flag set on the sections that you want to unsketch

  • redraw (optional) (boolean)

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

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

    Section object.

    Return type

    Section

    Example

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

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


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

    Description

    Adds a warning for section. 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 section s:

    s.Warning("My custom warning");


    Xrefs()

    Description

    Returns the cross references for this section.

    Arguments

    No arguments

    Returns

    Xrefs object.

    Return type

    Xrefs

    Example

    To get the cross references for section s:

    var xrefs = s.Xrefs();


    toString()

    Description

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

    Arguments

    No arguments

    Returns

    string

    Return type

    String

    Example

    To get data for section s in keyword format

    var str = s.toString();