Shell class

The Shell class gives you access to shell 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

Shell constants

Name Description
Shell.EDGE_1 Edge 1 of shell
Shell.EDGE_2 Edge 2 of shell
Shell.EDGE_3 Edge 3 of shell
Shell.EDGE_4 Edge 4 of shell

Shell properties

Name Type Description
beta real Orthotropic material base offset angle. null if the _BETA option is not set. If not null then this is the angle in degrees and the _BETA option is set. This is required to distinguish between the cases of _BETA not being used (beta === null) and _BETA being set but the angle being zero (beta === 0). Prior to version 18 _BETA was only set if beta was non-zero. This was fixed in version 18 and the test changed to beta not being null. Note: If this option is set then mcid should be 0
colour Colour The colour of the shell
composite logical If COMPOSITE option is set. Can be true or false
composite_long logical If COMPOSITE_LONG option is set. Can be true or false
dof logical If DOF option is set. Can be true or false
edges constant Bitwise code of Shell.EDGE_1, Shell.EDGE_2, Shell.EDGE_3 and Shell.EDGE_4 representing which edges of the shell are free edges
eid integer Shell number. Also see the label property which is an alternative name for this.
exists (read only) logical true if shell exists, false if referred to but not defined.
include integer The Include file number that the shell is in.
label integer Shell number. Also see the eid property which is an alternative name for this.
mcid integer Material coordinate system ID. If non zero then the _MCID option is assumed. Note: If this option is set then beta should be null.
model (read only) integer The Model number that the shell is in.
n1 integer Node number 1
n2 integer Node number 2
n3 integer Node number 3
n4 integer Node number 4
n5 integer Node number 5
n6 integer Node number 6
n7 integer Node number 7
n8 integer Node number 8
nip logical Number of integration points for composite shell
nodes (read only) integer Number of nodes shell has
ns1 integer Scalar Node number 1
ns2 integer Scalar Node number 2
ns3 integer Scalar Node number 3
ns4 integer Scalar Node number 4
offset real Offset distance. If non zero then the _OFFSET option is assumed
pid integer Part number
shl4_to_shl8 logical If SHL4_TO_SHL8 option is set. Can be true or false
thic1 real Thickness at node 1
thic2 real Thickness at node 2
thic3 real Thickness at node 3
thic4 real Thickness at node 4
thic5 real Thickness at node 5 (if 8 noded shell)
thic6 real Thickness at node 6 (if 8 noded shell)
thic7 real Thickness at node 7 (if 8 noded shell)
thic8 real Thickness at node 8 (if 8 noded shell)
thickness logical If _THICKNESS option is set. Can be true or false
transparency integer The transparency of the shell (0-100) 0% is opaque, 100% is transparent.

Detailed Description

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

Constructor

new Shell(Model[Model], eid[integer], pid[integer], n1[integer], n2[integer], n3[integer], n4 (optional)[integer], n5 (optional)[integer], n6 (optional)[integer], n7 (optional)[integer], n8 (optional)[integer])

Description

Create a new Shell object. Use either 3, 4, 6 or 8 nodes when creating a new shell. If you are creating a 3 noded shell either only give 3 nodes or give 4 nodes but make nodes 3 and 4 the same number. Similarly, 6 noded shells can be created with 6 node arguments or with 8 nodes but nodes 3 and 4 the same number and nodes 7 and 8 the same number.

Arguments

  • Model (Model)

    Model that shell will be created in

  • eid (integer)

    Shell number

  • pid (integer)

    Part number

  • n1 (integer)

    Node number 1

  • n2 (integer)

    Node number 2

  • n3 (integer)

    Node number 3

  • n4 (optional) (integer)

    Node number 4

  • n5 (optional) (integer)

    Node number 5

  • n6 (optional) (integer)

    Node number 6

  • n7 (optional) (integer)

    Node number 7

  • n8 (optional) (integer)

    Node number 8

    Returns

    Shell object

    Return type

    Shell

    Example

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

    var s = new Shell(m, 100, 10, 1, 2, 3, 4);

    Details of functions

    Angles()

    Description

    Calculates the minimum and maximum internal angles (in degrees) for the shell

    Arguments

    No arguments

    Returns

    Array of numbers containing min and max angles

    Return type

    Number

    Example

    To calculate the maximum and minimum internal angles for shell s:

    var angles = s.Angles();
    var min = angles[0];
    var max = angles[1];


    Area()

    Description

    Calculates the area for the shell

    Arguments

    No arguments

    Returns

    real

    Return type

    Number

    Example

    To calculate the area for shell s:

    var area = s.Area();


    AspectRatio()

    Description

    Calculates the aspect ratio for the shell

    Arguments

    No arguments

    Returns

    real

    Return type

    Number

    Example

    To calculate the aspect ratio for shell s:

    var ratio = s.AspectRatio();


    AssociateComment(Comment[Comment])

    Description

    Associates a comment with a shell.

    Arguments

  • Comment (Comment)

    Comment that will be attached to the shell

    Returns

    No return value

    Example

    To associate comment c to the shell s:

    s.AssociateComment(c);


    Blank()

    Description

    Blanks the shell

    Arguments

    No arguments

    Returns

    No return value

    Example

    To blank shell s:

    s.Blank();


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

    Description

    Blanks all of the shells in the model.

    Arguments

  • Model (Model)

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

    Shell.BlankAll(m);


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

    Description

    Blanks all of the flagged shells in the model.

    Arguments

  • Model (Model)

    Model that all the flagged shells will be blanked in

  • flag (Flag)

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

    Shell.BlankFlagged(m, f);


    Blanked()

    Description

    Checks if the shell is blanked or not.

    Arguments

    No arguments

    Returns

    true if blanked, false if not.

    Return type

    Boolean

    Example

    To check if shell 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 shell s:

    s.Browse();


    ClearFlag(flag[Flag])

    Description

    Clears a flag on the shell.

    Arguments

  • flag (Flag)

    Flag to clear on the shell

    Returns

    No return value

    Example

    To clear flag f for shell s:

    s.ClearFlag(f);


    CoordsToIsoparametric(x[real], y[real], z[real])

    Description

    Calculates the isoparametric coordinates for a point on the shell.

    Arguments

  • x (real)

    X coordinate of point

  • y (real)

    Y coordinate of point

  • z (real)

    Z coordinate of point

    Returns

    Array containing s and t isoparametric coordinates and the distance the point is from the shell (positive in direction of shell normal). If it is not possible to calculate the isoparametric coordinates null is returned.

    Return type

    Array

    Example

    To calculate the isoparametric coordinates of point (10, 20, 30) on shell s:

    var isocoords = s.CoordsToIsoparametric(10, 20, 30);


    Copy(range (optional)[boolean])

    Description

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

    Shell object

    Return type

    Shell

    Example

    To copy shell s into shell z:

    var z = s.Copy();


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

    Description

    Starts an interactive editing panel to create a shell

    Arguments

  • Model (Model)

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

    Shell object (or null if not made).

    Return type

    Shell

    Example

    To start creating a shell in model m:

    var s = Shell.Create(m);


    DetachComment(Comment[Comment])

    Description

    Detaches a comment from a shell.

    Arguments

  • Comment (Comment)

    Comment that will be detached from the shell

    Returns

    No return value

    Example

    To detach comment c from the shell 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 shell s:

    s.Edit();


    ElemCut(Database cross section label[integer])

    Description

    Returns coordinates of the intersections between a shell and a database cross section.

    Arguments

  • Database cross section label (integer)

    The label of the database cross section.

    Returns

    An array containing the x1,y1,z1,x2,y2,z2 coordinates of the cut line, or NULL if it does not cut. Note this function does not check that the shell is in the cross section definition (part set)

    Return type

    Array

    Example

    To get the cut line coordinates between database cross section 200 and shell s:

    var data = s.ElemCut(200)


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

    Description

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

    s.Error("My custom error");


    ExtractColour()

    Description

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

    Arguments

    No arguments

    Returns

    colour value (integer)

    Return type

    Number

    Example

    To return the colour used for drawing shell s:

    var colour = s.ExtractColour();


    FillAttachedHole(pid[integer], size[real])

    Description

    Fills in (meshes) a hole attached to the shell.

    Arguments

  • pid (integer)

    The Part number that the new shells will be created in.

  • size (real)

    The size for created elements.

    Returns

    No return value.

    Example

    To fill in a hole attached to shell s, putting new shells with size 5.0 into part 100:

    s.FillAttachedHole(100, 5.0);


    FillHolesOnFlagged(Model[Model], Flag[Flag], RemeshHole[boolean], pid (optional)[integer], Max Hole Size (optional)[real], Mesh Element size (optional)[real], planarSurface (optional)[boolean]) [static]

    Description

    Fills multiple holes using flagged shells.

    Arguments

  • Model (Model)

    Model that all shells are in.

  • Flag (Flag)

    flag bit

  • RemeshHole (boolean)

    TRUE if elements around the hole should be remeshed

  • pid (optional) (integer)

    Needs to be specified if RemeshHole is FALSE. Specifies the Part id where the mesh is filled

  • Max Hole Size (optional) (real)

    Maximum size of the hole which is to be filled. If omitted a default size of 20.0 will be set

  • Mesh Element size (optional) (real)

    Element size of the mesh which fills the hole. If omitted a default size of 10.0 will be set

  • planarSurface (optional) (boolean)

    Needs to be specified if RemeshHole is TRUE. TRUE if we need to Use planar surface

    Returns

    No return value.

    Example

    To fill holes on flagged shells:

    Shell.FillHolesOnFlagged(m, flag, 1, 112, 60.5, 5.34 ,0);

    Note: pid is required when RemeshHole is FALSE

    Shell.FillHolesOnFlagged(m, flag, 0, 112);


    FindShellInBox(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 Shell objects for the shells within a box. Please note in (default) inclusive mode this function provides a list of all shells that could potentially be in the box (using computationally cheap bounding box comparison - local box vs main box). NOTE - it is not a rigorous test of whether the shell is actually in the box. An extension of "spot_thickness" is applied to each local shell box. By default this is 10mm. You can use "Options.connection_max_thickness = x" to reduce this value. This may return shells that are ostensibly outside box. The user should apply their own test on each shell returned. The purpose of this function is to reduce the number of shells you need to test. Setting the exclusive option will only return shells that are fully contained in the main box This may not capture all the shells you want to process so must be used with care.

    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 shells considered, if 0 all shells considered

  • excl (optional) (integer)

    Optional flag ( 0) Apply inclusive selection with local box extension = "spot_thickness" (default 10) (-1) Apply inclusive selection with local box extension = 0.5*shell thickness ( 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 shells only (1), if (0) all shells considered

    Returns

    Array of Shell objects

    Return type

    Array

    Example

    To get an array of Shell objects for flagged shells within defined box.

    var s = Shell.FindShellInBox(m, xmin, xmax, ymin, ymax, zmin, zmax, flag, 0, 0);


    FindShellInit(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 shells 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 Shell.FindShellInBox()

    Arguments

  • Model (Model)

    Model in which shells have been flagged

  • flag (optional) (Flag)

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

    Returns

    No return value

    Example

    To initialize find setup for flagged shells in model m:

    Shell.FindShellInit(m, flag);


    First(Model[Model]) [static]

    Description

    Returns the first shell in the model.

    Arguments

  • Model (Model)

    Model to get first shell in

    Returns

    Shell object (or null if there are no shells in the model).

    Return type

    Shell

    Example

    To get the first shell in model m:

    var s = Shell.First(m);


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

    Description

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

    Arguments

  • Model (Model)

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

    Shell label.

    Return type

    Number

    Example

    To get the first free shell label in model m:

    var label = Shell.FirstFreeLabel(m);


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

    Description

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

    Arguments

  • Model (Model)

    Model that all shells will be flagged in

  • flag (Flag)

    Flag to set on the shells

    Returns

    No return value

    Example

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

    Shell.FlagAll(m, f);


    Flagged(flag[Flag])

    Description

    Checks if the shell is flagged or not.

    Arguments

  • flag (Flag)

    Flag to test on the shell

    Returns

    true if flagged, false if not.

    Return type

    Boolean

    Example

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

    Arguments

  • Model (Model)

    Model that all shells are in

  • func (function)

    Function to call for each shell

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

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

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

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


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

    Description

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

    Arguments

  • Model (Model)

    Model to get shells from

  • property (optional) (string)

    Name for property to get for all shells in the model

    Returns

    Array of Shell objects or properties

    Return type

    Array

    Example

    To make an array of Shell objects for all of the shells in model m:

    var a = Shell.GetAll(m);

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

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


    GetAttachedShells(tolerance (optional)[real], recursive (optional)[boolean])

    Description

    Returns the shells that are attached to the shell. Note that 'attached' means that the shells must share 2 nodes.

    Arguments

  • tolerance (optional) (real)

    This tolerance can be used to limit the selection to shells whose normal vector is within this tolerance (in degrees) of the original shell. If omitted the tolerance is 180 degrees.

  • recursive (optional) (boolean)

    If recursive is false then only the shells actually attached to the shell will be returned (this could also be done by using the Xrefs class but this method is provided for convenience. If recursive is true then PRIMER will keep finding attached shells until no more can be found. If omitted recursive will be false.

    Returns

    Array of Shell objects (or null if there are no attached shells).

    Return type

    Array

    Example

    To find the shells attached to shell s with a 10 degree tolerance, growing the selection until no more shells can be found:

    var shell_array = s.GetAttachedShells(10, true);


    GetComments()

    Description

    Extracts the comments associated to a shell.

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

    var comm_array = s.GetComments();


    GetCompositeData(ipt[integer])

    Description

    Returns the composite data for an integration point in *ELEMENT_SHELL_COMPOSITE.

    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 material ID, thickness and beta angle values. If the _COMPOSITE_LONG option is set, then the array returned will also contain the ply ID.

    Return type

    Array

    Example

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

    if (s.composite && s.nip >= 3)
    {
        var ipt_data = s.GetCompositeData(2);
    }


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

    Description

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

    Arguments

  • Model (Model)

    Model to get shells from

  • flag (Flag)

    Flag set on the shells that you want to retrieve

  • property (optional) (string)

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

    Returns

    Array of Shell objects or properties

    Return type

    Array

    Example

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

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

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

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


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

    Description

    Returns the Shell object for a shell ID.

    Arguments

  • Model (Model)

    Model to find the shell in

  • number (integer)

    number of the shell you want the Shell object for

    Returns

    Shell object (or null if shell does not exist).

    Return type

    Shell

    Example

    To get the Shell object for shell 100 in model m

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


    GetNodeIDs()

    Description

    Returns the labels of the nodes on the shell as an array. See also Shell.GetNodes()

    Arguments

    No arguments

    Returns

    Array of node labels (integers)

    Return type

    Number

    Example

    To return the node labels of shell s as an array

    var nodes = s.GetNodeIDs();


    GetNodes()

    Description

    Returns the nodes on the shell as an array of Node objects. See also Shell.GetNodeIDs()

    Arguments

    No arguments

    Returns

    Array of Node objects

    Return type

    Array

    Example

    To return the nodes of shell s as an array

    var nodes = s.GetNodes();


    GetParameter(prop[string])

    Description

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

    Arguments

  • prop (string)

    shell property to get parameter for

    Returns

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

    Return type

    Parameter

    Example

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

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


    GetShellReferenceGeometry()

    Description

    Returns the airbag shell reference geometry of the shell

    Arguments

    No arguments

    Returns

    The shell reference geometry ID of the shell (or 0 if it hasn't got any)

    Return type

    Number

    Example

    To get the shell reference geometry of the shell s:

    var a = s.GetShellReferenceGeometry();


    IsoparametricToCoords(s[real], t[real])

    Description

    Calculates the coordinates for a point on the shell from the isoparametric coords.

    Arguments

  • s (real)

    First isoparametric coordinate

  • t (real)

    Second isoparametric coordinate

    Returns

    Array of numbers containing x, y and z or null if not possible to calculate.

    Return type

    Number

    Example

    To calculate the coordinates of isoparametric point (0.5, -0.5) on shell s:

    var coords = s.IsoparametricToCoords(0.5, -0.5);


    Jacobian()

    Description

    Calculates the jacobian for the shell

    Arguments

    No arguments

    Returns

    real

    Return type

    Number

    Example

    To calculate the jacobian for shell s:

    var jacobian = s.Jacobian();


    Keyword()

    Description

    Returns the keyword for this shell (*SHELL, *SHELL_SCALAR or *SHELL_SCALAR_VALUE). Note that a carriage return is not added. See also Shell.KeywordCards()

    Arguments

    No arguments

    Returns

    string containing the keyword.

    Return type

    String

    Example

    To get the keyword for shell s:

    var key = s.Keyword();


    KeywordCards()

    Description

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

    Arguments

    No arguments

    Returns

    string containing the cards.

    Return type

    String

    Example

    To get the cards for shell s:

    var cards = s.KeywordCards();


    Last(Model[Model]) [static]

    Description

    Returns the last shell in the model.

    Arguments

  • Model (Model)

    Model to get last shell in

    Returns

    Shell object (or null if there are no shells in the model).

    Return type

    Shell

    Example

    To get the last shell in model m:

    var s = Shell.Last(m);


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

    Description

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

    Arguments

  • Model (Model)

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

    Shell label.

    Return type

    Number

    Example

    To get the last free shell label in model m:

    var label = Shell.LastFreeLabel(m);


    Length()

    Description

    Calculates the minimum length for the shell

    Arguments

    No arguments

    Returns

    real

    Return type

    Number

    Example

    To calculate the minimum length for shell s:

    var length = s.Length();


    MakeConsistentNormalsFlagged(Model[Model], Flag[Flag], Shell label (optional)[integer]) [static]

    Description

    Make all the flagged SHELL normals consistent with a selected one, the Seed Element.

    Arguments

  • Model (Model)

    Model that all shells are in.

  • Flag (Flag)

    flag bit

  • Shell label (optional) (integer)

    The label of the seed shell. If omitted, or null, the first flagged shell is used as the seed shell.

    Returns

    Array containing the labels of shells which have had normals reversed

    Return type

    Array

    Example

    To make all flagged shell normals consistent:

    Shell.MakeConsistentNormalsFlagged(m, flag, 1001);


    Next()

    Description

    Returns the next shell in the model.

    Arguments

    No arguments

    Returns

    Shell object (or null if there are no more shells in the model).

    Return type

    Shell

    Example

    To get the shell in model m after shell s:

    var s = s.Next();


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

    Description

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

    Arguments

  • Model (Model)

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

    Shell label.

    Return type

    Number

    Example

    To get the next free shell label in model m:

    var label = Shell.NextFreeLabel(m);


    NormalVector()

    Description

    Calculates the unit normal vector for the shell.

    Arguments

    No arguments

    Returns

    Array of numbers containing x, y and z components of unit normal vector or null if the vector cannot be calculated (for example if the shell has zero area).

    Return type

    Number

    Example

    To calculate the normal vector of shell s:

    var nvector = s.NormalVector();


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

    Description

    Allows the user to pick a shell.

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

    Shell object (or null if not picked)

    Return type

    Shell

    Example

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

    var s = Shell.Pick('Pick shell from screen', m);


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

    Description

    Allows the user to pick a point on a shell. The isoparametric coordinates of the point picked on the shell are returned as well as the shell picked. These coordinates are suitable for using in the function Shell.IsoparametricToCoords(). See also Shell.Pick()

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

    Array containing Shell object and isoparametric coordinates (or null if not picked or the point is not on a shell)

    Return type

    Array

    Example

    To pick a point on a shell from model m giving the prompt 'Pick a point on a shell on the screen':

    var a = Shell.PickIsoparametric('Pick a point on a shell on the screen', m);
    if (a != null)
    {
        Message("You picked point "+a[1]+","+a[2]+" on shell "+a[0].label);
    }
    


    Previous()

    Description

    Returns the previous shell in the model.

    Arguments

    No arguments

    Returns

    Shell object (or null if there are no more shells in the model).

    Return type

    Shell

    Example

    To get the shell in model m before shell s:

    var s = s.Previous();


    RemoveCompositeData(ipt[integer])

    Description

    Removes the composite data for an integration point in *ELEMENT_SHELL_COMPOSITE.

    Arguments

  • ipt (integer)

    The integration point you want to remove. Note that integration points start at 0, not 1.

    Returns

    No return value.

    Example

    To remove the composite data for the 3rd integration point for shell s:

    s.RemoveCompositeData(2);


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

    Description

    Renumbers all of the shells in the model.

    Arguments

  • Model (Model)

    Model that all shells will be renumbered in

  • start (integer)

    Start point for renumbering

    Returns

    No return value

    Example

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

    Shell.RenumberAll(m, 1000000);


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

    Description

    Renumbers all of the flagged shells in the model.

    Arguments

  • Model (Model)

    Model that all the flagged shells will be renumbered in

  • flag (Flag)

    Flag set on the shells that you want to renumber

  • start (integer)

    Start point for renumbering

    Returns

    No return value

    Example

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

    Shell.RenumberFlagged(m, f, 1000000);


    ReverseNormal(redraw (optional)[boolean])

    Description

    Reverse shell normal.

    Arguments

  • redraw (optional) (boolean)

    If model should be redrawn or not. If omitted redraw is false. If you want to reverse several shell normals and only redraw after the last one then use false for all redraws apart from the last one.

    Returns

    No return value.

    Example

    To Reverse shell normal for shell s:

    s.ReverseNormal();


    ReverseNormalsFlagged(Model[Model], Flag[Flag]) [static]

    Description

    Reverse all the flagged shell normals

    Arguments

  • Model (Model)

    Model that all shells are in.

  • Flag (Flag)

    flag bit

    Returns

    No return value.

    Example

    To Reverse all flagged shell normals:

    Shell.ReverseNormalsFlagged(m, flag);


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

    Description

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

    Arguments

  • flag (Flag)

    Flag to use when selecting shells

  • prompt (string)

    Text to display as a prompt to the user

  • limit (optional) (Model or Flag)

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

    Return type

    Number

    Example

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

    Shell.Select(f, 'Select shells', m);

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

    Shell.Select(f, 'Select shells', l);


    SetCompositeData(ipt[integer], mid[integer], thick[real], beta[real], plyid (optional)[integer])

    Description

    Sets the composite data for an integration point in *ELEMENT_SHELL_COMPOSITE.

    Arguments

  • ipt (integer)

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

  • mid (integer)

    Material ID for the integration point.

  • thick (real)

    Thickness of the integration point.

  • beta (real)

    Material angle of the integration point.

  • plyid (optional) (integer)

    Ply ID for the integration point. This should be used if the _COMPOSITE_LONG option is set for the shell.

    Returns

    No return value.

    Example

    To set the composite data for the 3rd integration point to mat 1, thickness 0.5 and angle 45, for shell s:

    s.SetCompositeData(2, 1, 0.5, 45);


    SetFlag(flag[Flag])

    Description

    Sets a flag on the shell.

    Arguments

  • flag (Flag)

    Flag to set on the shell

    Returns

    No return value

    Example

    To set flag f for shell s:

    s.SetFlag(f);


    Sketch(redraw (optional)[boolean])

    Description

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

    Arguments

  • redraw (optional) (boolean)

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

    Returns

    No return value

    Example

    To sketch shell s:

    s.Sketch();


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

    Description

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

    Arguments

  • Model (Model)

    Model that all the flagged shells will be sketched in

  • flag (Flag)

    Flag set on the shells that you want to sketch

  • redraw (optional) (boolean)

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

    Shell.SketchFlagged(m, flag);


    Skew()

    Description

    Calculates the skew for the shell

    Arguments

    No arguments

    Returns

    real

    Return type

    Number

    Example

    To calculate the skew for shell s:

    var skew = s.Skew();


    Taper()

    Description

    Calculates the taper for the shell

    Arguments

    No arguments

    Returns

    real

    Return type

    Number

    Example

    To calculate the taper for shell s:

    var taper = s.Taper();


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

    Description

    Checks if nodes of shell 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 shell 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) captured by contact

    Returns

    string

    Return type

    String

    Example

    To check if all nodes of shell s are tied by contact 200 or attach directly to constraint:

    var message = s.TiedNodeCheck(200, flag, 1, 1)


    Timestep()

    Description

    Calculates the timestep for the shell

    Arguments

    No arguments

    Returns

    real

    Return type

    Number

    Example

    To calculate the timestep for shell s:

    var timestep = s.Timestep();


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

    Description

    Returns the total number of shells in the model.

    Arguments

  • Model (Model)

    Model to get total for

  • exists (optional) (boolean)

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

    Returns

    number of shells

    Return type

    Number

    Example

    To get the total number of shells in model m:

    var total = Shell.Total(m);


    Unblank()

    Description

    Unblanks the shell

    Arguments

    No arguments

    Returns

    No return value

    Example

    To unblank shell s:

    s.Unblank();


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

    Description

    Unblanks all of the shells in the model.

    Arguments

  • Model (Model)

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

    Shell.UnblankAll(m);


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

    Description

    Unblanks all of the flagged shells in the model.

    Arguments

  • Model (Model)

    Model that the flagged shells will be unblanked in

  • flag (Flag)

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

    Shell.UnblankFlagged(m, f);


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

    Description

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

    Arguments

  • Model (Model)

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

  • flag (Flag)

    Flag to unset on the shells

    Returns

    No return value

    Example

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

    Shell.UnflagAll(m, f);


    Unsketch(redraw (optional)[boolean])

    Description

    Unsketches the shell.

    Arguments

  • redraw (optional) (boolean)

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

    Returns

    No return value

    Example

    To unsketch shell s:

    s.Unsketch();


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

    Description

    Unsketches all shells.

    Arguments

  • Model (Model)

    Model that all shells will be unblanked in

  • redraw (optional) (boolean)

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

    Shell.UnsketchAll(m);


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

    Description

    Unsketches all flagged shells in the model.

    Arguments

  • Model (Model)

    Model that all shells will be unsketched in

  • flag (Flag)

    Flag set on the shells that you want to unsketch

  • redraw (optional) (boolean)

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

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

    Shell object.

    Return type

    Shell

    Example

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

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


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

    Description

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

    s.Warning("My custom warning");


    Warpage()

    Description

    Calculates the warpage for the shell

    Arguments

    No arguments

    Returns

    real

    Return type

    Number

    Example

    To calculate the warpage for shell s:

    var warpage = s.Warpage();


    WeightingFactors(s[real], t[real])

    Description

    Calculates the weighting factors for a point on the shell from the isoparametric coords.

    Arguments

  • s (real)

    First isoparametric coordinate

  • t (real)

    Second isoparametric coordinate

    Returns

    Array of numbers containing weighting factors or null if not possible to calculate.

    Return type

    Number

    Example

    To calculate the weighting factors of isoparametric point (0.5, -0.5) on shell s:

    var weights = s.WeightingFactors(0.5, -0.5);


    Xrefs()

    Description

    Returns the cross references for this shell.

    Arguments

    No arguments

    Returns

    Xrefs object.

    Return type

    Xrefs

    Example

    To get the cross references for shell s:

    var xrefs = s.Xrefs();


    toString()

    Description

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

    Arguments

    No arguments

    Returns

    string

    Return type

    String

    Example

    To get data for shell s in keyword format

    var str = s.toString();