Solid class

The Solid class gives you access to solid 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

Solid constants

Name Description
Solid.EDGE_1 Edge 1 of solid
Solid.EDGE_10 Edge 10 of solid
Solid.EDGE_11 Edge 11 of solid
Solid.EDGE_12 Edge 12 of solid
Solid.EDGE_2 Edge 2 of solid
Solid.EDGE_3 Edge 3 of solid
Solid.EDGE_4 Edge 4 of solid
Solid.EDGE_5 Edge 5 of solid
Solid.EDGE_6 Edge 6 of solid
Solid.EDGE_7 Edge 7 of solid
Solid.EDGE_8 Edge 8 of solid
Solid.EDGE_9 Edge 9 of solid
Solid.FACE_1 Face 1 of solid
Solid.FACE_2 Face 2 of solid
Solid.FACE_3 Face 3 of solid
Solid.FACE_4 Face 4 of solid
Solid.FACE_5 Face 5 of solid
Solid.FACE_6 Face 6 of solid

Solid properties

Name Type Description
a1 real x component of material direction a
a2 real y component of material direction a
a3 real z component of material direction a
colour Colour The colour of the solid
d1 real x component of material in-plane vector
d2 real y component of material in-plane vector
d3 real z component of material in-plane vector
dof logical If DOF option is set. Can be true or false
edges constant Bitwise code of Solid.EDGE_1, Solid.EDGE_2, Solid.EDGE_3, Solid.EDGE_4, Solid.EDGE_5, Solid.EDGE_6, Solid.EDGE_7, Solid.EDGE_8, Solid.EDGE_9, Solid.EDGE_10, Solid.EDGE_11 and Solid.EDGE_12 representing which edges of the solid are free faces
eid integer Solid number. Also see the label property which is an alternative name for this.
exists (read only) logical true if solid exists, false if referred to but not defined.
faces constant Bitwise code of Solid.FACE_1, Solid.FACE_2, Solid.FACE_3, Solid.FACE_4, Solid.FACE_5 and Solid.FACE_6 representing which faces of the solid are internal faces. Note that this is calculated from the solids that are currently visible so blanking solids will affect this property once graphics have been updated.
h20 logical If _H20 option is set. Can be true or false
h27 logical If _H27 option is set. Can be true or false
h64 logical If _H64 option is set. Can be true or false
h8toh20 logical If _H8TOH20 option is set. Can be true or false
h8toh27 logical If _H8TOH27 option is set. Can be true or false
h8toh64 logical If _H8TOH64 option is set. Can be true or false
include integer The Include file number that the solid is in.
label integer Solid number. Also see the eid property which is an alternative name for this.
model (read only) integer The Model number that the solid is in.
n1 integer Node number 1
n10 integer Node number 10
n11 integer Node number 11
n12 integer Node number 12
n13 integer Node number 13
n14 integer Node number 14
n15 integer Node number 15
n16 integer Node number 16
n17 integer Node number 17
n18 integer Node number 18
n19 integer Node number 19
n2 integer Node number 2
n20 integer Node number 20
n21 integer Node number 21
n22 integer Node number 22
n23 integer Node number 23
n24 integer Node number 24
n25 integer Node number 25
n26 integer Node number 26
n27 integer Node number 27
n28 integer Node number 28
n29 integer Node number 29
n3 integer Node number 3
n30 integer Node number 30
n31 integer Node number 31
n32 integer Node number 32
n33 integer Node number 33
n34 integer Node number 34
n35 integer Node number 35
n36 integer Node number 36
n37 integer Node number 37
n38 integer Node number 38
n39 integer Node number 39
n4 integer Node number 4
n40 integer Node number 40
n41 integer Node number 41
n42 integer Node number 42
n43 integer Node number 43
n44 integer Node number 44
n45 integer Node number 45
n46 integer Node number 46
n47 integer Node number 47
n48 integer Node number 48
n49 integer Node number 49
n5 integer Node number 5
n50 integer Node number 50
n51 integer Node number 51
n52 integer Node number 52
n53 integer Node number 53
n54 integer Node number 54
n55 integer Node number 55
n56 integer Node number 56
n57 integer Node number 57
n58 integer Node number 58
n59 integer Node number 59
n6 integer Node number 6
n60 integer Node number 60
n61 integer Node number 61
n62 integer Node number 62
n63 integer Node number 63
n64 integer Node number 64
n7 integer Node number 7
n8 integer Node number 8
n9 integer Node number 9
nodes (read only) integer Number of nodes solid 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
ns5 integer Scalar Node number 5
ns6 integer Scalar Node number 6
ns7 integer Scalar Node number 7
ns8 integer Scalar Node number 8
ortho logical If _ORTHO option is set. Can be true or false
p21 logical If _P21 option is set. Can be true or false
p40 logical If _P40 option is set. Can be true or false
pid integer Part number
t15 logical If _T15 option is set. Can be true or false
t20 logical If _T20 option is set. Can be true or false
tet4totet10 logical If _TET4TOTET10 option is set. Can be true or false
transparency integer The transparency of the solid (0-100) 0% is opaque, 100% is transparent.

Detailed Description

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

Constructor

new Solid(Model[Model], options [object])

Description

Create a new Solid object. If you are creating a 4 noded solid either only give 4 nodes or give 8 nodes but make nodes 4 to 8 the same number. If you are creating a 6 noded solid either only give 6 nodes or give 8 nodes but make nodes 5 and 6 the same number and nodes 7 and 8 the same number.

Arguments

  • Model (Model)

    Model that solid will be created in

  • options (object)

    Options for creating the solid

    Object has the following properties:

    Name Type Description
    eid integer Solid number
    nodes array Array of Node IDs for the solid. At least 4 nodes must be given
    pid integer Part number

    Returns

    Solid object

    Return type

    Solid

    Example

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

    var s = new Solid(m, {eid: 100, pid: 10, nodes: [1,2,3,4]} );

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

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

    Create a new Solid object. Use either 4, 6 or 8 nodes when creating a new solid. If you are creating a 4 noded solid either only give 4 nodes or give 8 nodes but make nodes 4 to 8 the same number. If you are creating a 6 noded solid either only give 6 nodes or give 8 nodes but make nodes 5 and 6 the same number and nodes 7 and 8 the same number.

    Arguments

  • Model (Model)

    Model that solid will be created in

  • eid (integer)

    Solid number

  • pid (integer)

    Part number

  • n1 (integer)

    Node number 1 or array containing all nodes (in which case other no other arguement has to be given after this)

  • n2 (integer)

    Node number 2

  • n3 (integer)

    Node number 3

  • n4 (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

    Solid object

    Return type

    Solid

    Example

    To create a new solid in model m with label 100, part 10 and nodes 1, 2, 3, 4, 5, 6, 7, 8:

    var s = new Solid(m, 100, 10, 1, 2, 3, 4, 5, 6, 7, 8); 

    Details of functions

    AspectRatio()

    Description

    Calculates the aspect ratio for the solid

    Arguments

    No arguments

    Returns

    real

    Return type

    Number

    Example

    To calculate the aspect ratio for solid s:

    var ratio = s.AspectRatio();


    AssociateComment(Comment[Comment])

    Description

    Associates a comment with a solid.

    Arguments

  • Comment (Comment)

    Comment that will be attached to the solid

    Returns

    No return value

    Example

    To associate comment c to the solid s:

    s.AssociateComment(c);


    Blank()

    Description

    Blanks the solid

    Arguments

    No arguments

    Returns

    No return value

    Example

    To blank solid s:

    s.Blank();


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

    Description

    Blanks all of the solids in the model.

    Arguments

  • Model (Model)

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

    Solid.BlankAll(m);


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

    Description

    Blanks all of the flagged solids in the model.

    Arguments

  • Model (Model)

    Model that all the flagged solids will be blanked in

  • flag (Flag)

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

    Solid.BlankFlagged(m, f);


    Blanked()

    Description

    Checks if the solid is blanked or not.

    Arguments

    No arguments

    Returns

    true if blanked, false if not.

    Return type

    Boolean

    Example

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

    s.Browse();


    ClearFlag(flag[Flag])

    Description

    Clears a flag on the solid.

    Arguments

  • flag (Flag)

    Flag to clear on the solid

    Returns

    No return value

    Example

    To clear flag f for solid s:

    s.ClearFlag(f);


    CoordsToIsoparametric(Model[Model], x[real], y[real], z[real], n1[integer], n2[integer], n3[integer], n4[integer]) [static]

    Description

    Calculates the isoparametric coordinates for a point on 3 or 4 noded segment

    Arguments

  • Model (Model)

    Model designated model

  • x (real)

    X coordinate of point

  • y (real)

    Y coordinate of point

  • z (real)

    Z coordinate of point

  • n1 (integer)

    node 1 of segment

  • n2 (integer)

    node 2 of segment

  • n3 (integer)

    node 3 of segment

  • n4 (integer)

    node 4 of segment

    Returns

    Array containing s and t isoparametric coordinates and the distance the point is from the segment If it is not possible to calculate the isoparametric coordinates null is returned.

    Return type

    Array

    Example

    To calculate the isoparametric coordinates of point (100, 100, 20) on segment defined by nodes 11,12,13,14:

    var isocoords = Solid.CoordsToIsoparametric(100, 100, 20, 11, 12, 13, 14);


    Copy(range (optional)[boolean])

    Description

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

    Solid object

    Return type

    Solid

    Example

    To copy solid s into solid z:

    var z = s.Copy();


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

    Description

    Starts an interactive editing panel to create a solid

    Arguments

  • Model (Model)

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

    Solid object (or null if not made).

    Return type

    Solid

    Example

    To start creating a solid in model m:

    var s = Solid.Create(m);


    DetachComment(Comment[Comment])

    Description

    Detaches a comment from a solid.

    Arguments

  • Comment (Comment)

    Comment that will be detached from the solid

    Returns

    No return value

    Example

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

    s.Edit();


    ElemCut(Database cross section label[integer])

    Description

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

    Arguments

  • Database cross section label (integer)

    The label of the database cross section.

    Returns

    Object with the following properties:

    Name Type Description
    face1 Array of reals An array containing the x1,y1,z1,x2,y2,z2 coordinates of the cut line on the face 1. Null if no cut on this face.
    face2 Array of reals An array containing the x1,y1,z1,x2,y2,z2 coordinates of the cut line on the face 2. Null if no cut on this face.
    face3 Array of reals An array containing the x1,y1,z1,x2,y2,z2 coordinates of the cut line on the face 3. Null if no cut on this face.
    face4 Array of reals An array containing the x1,y1,z1,x2,y2,z2 coordinates of the cut line on the face 4. Null if no cut on this face.
    face5 Array of reals An array containing the x1,y1,z1,x2,y2,z2 coordinates of the cut line on the face 5. Null if no cut on this face.
    face6 Array of reals An array containing the x1,y1,z1,x2,y2,z2 coordinates of the cut line on the face 6. Null if no cut on this face.

    Return type

    object

    Example

    To see if the database cross section 200 cuts solid s and at which points it cuts face 3 of the solid:

    var data = s.ElemCut(200);
    var face = data.face3;
    if(face)
    {
       var point1_x = face[0];
       var point1_y = face[1];
       var point1_z = face[2];
       var point2_x = face[3];
       var point2_y = face[4];
       var point2_z = face[5];
    } 


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

    Description

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

    s.Error("My custom error");


    ExtractColour()

    Description

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

    Arguments

    No arguments

    Returns

    colour value (integer)

    Return type

    Number

    Example

    To return the colour used for drawing solid s:

    var colour = s.ExtractColour();


    FindSolidInBox(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 Solid objects for the solids within a box. Please note this function provides a list of all solids that could potentially be in the box (using computationally cheap bounding box comparison) it is not a rigorous test of whether the solid is actually in the box. This may include solids that are ostensibly outside box. The user should apply their own test. (this function is intended to provide an upper bound of elems to test) Setting the "excl" flag will require that the solid is fully contained but this may not capture all the solids you want to process.

    Arguments

  • Model (Model)

    Model designated model

  • xmin (real)

    Minimum bound in global x

  • xmax (real)

    Maximum bound in global x

  • ymin (real)

    Minimum bound in global y

  • ymax (real)

    Maximum bound in global y

  • zmin (real)

    Minimum bound in global z

  • zmax (real)

    Maximum bound in global z

  • flag (optional) (integer)

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

  • excl (optional) (integer)

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

  • vis_only (optional) (integer)

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

    Returns

    Array of Solid objects

    Return type

    Array

    Example

    To get an array of Solid objects for flagged solids within defined box (inclusive selection)

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


    FindSolidInit(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 solids 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 Solid.FindSolidInBox()

    Arguments

  • Model (Model)

    Model in which shells have been flagged

  • flag (optional) (Flag)

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

    Returns

    No return value

    Example

    To initialize find setup for flagged solids in model m:

    Solid.FindSolidInit(m, flag);


    First(Model[Model]) [static]

    Description

    Returns the first solid in the model.

    Arguments

  • Model (Model)

    Model to get first solid in

    Returns

    Solid object (or null if there are no solids in the model).

    Return type

    Solid

    Example

    To get the first solid in model m:

    var s = Solid.First(m);


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

    Description

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

    Arguments

  • Model (Model)

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

    Solid label.

    Return type

    Number

    Example

    To get the first free solid label in model m:

    var label = Solid.FirstFreeLabel(m);


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

    Description

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

    Arguments

  • Model (Model)

    Model that all solids will be flagged in

  • flag (Flag)

    Flag to set on the solids

    Returns

    No return value

    Example

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

    Solid.FlagAll(m, f);


    Flagged(flag[Flag])

    Description

    Checks if the solid is flagged or not.

    Arguments

  • flag (Flag)

    Flag to test on the solid

    Returns

    true if flagged, false if not.

    Return type

    Boolean

    Example

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

    Arguments

  • Model (Model)

    Model that all solids are in

  • func (function)

    Function to call for each solid

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

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

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

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


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

    Description

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

    Arguments

  • Model (Model)

    Model to get solids from

  • property (optional) (string)

    Name for property to get for all solids in the model

    Returns

    Array of Solid objects or properties

    Return type

    Array

    Example

    To make an array of Solid objects for all of the solids in model m:

    var a = Solid.GetAll(m);

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

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


    GetComments()

    Description

    Extracts the comments associated to a solid.

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

    var comm_array = s.GetComments();


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

    Description

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

    Arguments

  • Model (Model)

    Model to get solids from

  • flag (Flag)

    Flag set on the solids that you want to retrieve

  • property (optional) (string)

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

    Returns

    Array of Solid objects or properties

    Return type

    Array

    Example

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

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

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

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


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

    Description

    Returns the Solid object for a solid ID.

    Arguments

  • Model (Model)

    Model to find the solid in

  • number (integer)

    number of the solid you want the Solid object for

    Returns

    Solid object (or null if solid does not exist).

    Return type

    Solid

    Example

    To get the Solid object for solid 100 in model m

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


    GetParameter(prop[string])

    Description

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

    Arguments

  • prop (string)

    solid property to get parameter for

    Returns

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

    Return type

    Parameter

    Example

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

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


    Jacobian()

    Description

    Calculates the jacobian for the solid

    Arguments

    No arguments

    Returns

    real

    Return type

    Number

    Example

    To calculate the jacobian for solid s:

    var jacobian = s.Jacobian();


    Keyword()

    Description

    Returns the keyword for this solid (*SOLID, *SOLID_SCALAR or *SOLID_SCALAR_VALUE). Note that a carriage return is not added. See also Solid.KeywordCards()

    Arguments

    No arguments

    Returns

    string containing the keyword.

    Return type

    String

    Example

    To get the keyword for solid s:

    var key = s.Keyword();


    KeywordCards()

    Description

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

    Arguments

    No arguments

    Returns

    string containing the cards.

    Return type

    String

    Example

    To get the cards for solid s:

    var cards = s.KeywordCards();


    Last(Model[Model]) [static]

    Description

    Returns the last solid in the model.

    Arguments

  • Model (Model)

    Model to get last solid in

    Returns

    Solid object (or null if there are no solids in the model).

    Return type

    Solid

    Example

    To get the last solid in model m:

    var s = Solid.Last(m);


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

    Description

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

    Arguments

  • Model (Model)

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

    Solid label.

    Return type

    Number

    Example

    To get the last free solid label in model m:

    var label = Solid.LastFreeLabel(m);


    Next()

    Description

    Returns the next solid in the model.

    Arguments

    No arguments

    Returns

    Solid object (or null if there are no more solids in the model).

    Return type

    Solid

    Example

    To get the solid in model m after solid s:

    var s = s.Next();


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

    Description

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

    Arguments

  • Model (Model)

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

    Solid label.

    Return type

    Number

    Example

    To get the next free solid label in model m:

    var label = Solid.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 solid.

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

    Solid object (or null if not picked)

    Return type

    Solid

    Example

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

    var s = Solid.Pick('Pick solid from screen', m);


    Previous()

    Description

    Returns the previous solid in the model.

    Arguments

    No arguments

    Returns

    Solid object (or null if there are no more solids in the model).

    Return type

    Solid

    Example

    To get the solid in model m before solid s:

    var s = s.Previous();


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

    Description

    Renumbers all of the solids in the model.

    Arguments

  • Model (Model)

    Model that all solids will be renumbered in

  • start (integer)

    Start point for renumbering

    Returns

    No return value

    Example

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

    Solid.RenumberAll(m, 1000000);


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

    Description

    Renumbers all of the flagged solids in the model.

    Arguments

  • Model (Model)

    Model that all the flagged solids will be renumbered in

  • flag (Flag)

    Flag set on the solids that you want to renumber

  • start (integer)

    Start point for renumbering

    Returns

    No return value

    Example

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

    Solid.RenumberFlagged(m, f, 1000000);


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

    Description

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

    Arguments

  • flag (Flag)

    Flag to use when selecting solids

  • prompt (string)

    Text to display as a prompt to the user

  • limit (optional) (Model or Flag)

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

    Return type

    Number

    Example

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

    Solid.Select(f, 'Select solids', m);

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

    Solid.Select(f, 'Select solids', l);


    SetFlag(flag[Flag])

    Description

    Sets a flag on the solid.

    Arguments

  • flag (Flag)

    Flag to set on the solid

    Returns

    No return value

    Example

    To set flag f for solid s:

    s.SetFlag(f);


    Sketch(redraw (optional)[boolean])

    Description

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

    Arguments

  • redraw (optional) (boolean)

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

    Returns

    No return value

    Example

    To sketch solid s:

    s.Sketch();


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

    Description

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

    Arguments

  • Model (Model)

    Model that all the flagged solids will be sketched in

  • flag (Flag)

    Flag set on the solids that you want to sketch

  • redraw (optional) (boolean)

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

    Solid.SketchFlagged(m, flag);


    TetCollapse()

    Description

    Calculates the tetrahedral collapse for the solid

    Arguments

    No arguments

    Returns

    real

    Return type

    Number

    Example

    To calculate the tet collapse for solid s:

    var tet collapse = s.TetCollapse();


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

    Description

    Checks if nodes of solid 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 solid by reverse lookup.

  • Flag (Flag)

    flag bit

  • Option1 (integer)

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

  • Option2 (integer)

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

    Returns

    string

    Return type

    String

    Example

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

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


    Timestep()

    Description

    Calculates the timestep for the solid

    Arguments

    No arguments

    Returns

    real

    Return type

    Number

    Example

    To calculate the timestep for solid s:

    var timestep = s.Timestep();


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

    Description

    Returns the total number of solids in the model.

    Arguments

  • Model (Model)

    Model to get total for

  • exists (optional) (boolean)

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

    Returns

    number of solids

    Return type

    Number

    Example

    To get the total number of solids in model m:

    var total = Solid.Total(m);


    Unblank()

    Description

    Unblanks the solid

    Arguments

    No arguments

    Returns

    No return value

    Example

    To unblank solid s:

    s.Unblank();


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

    Description

    Unblanks all of the solids in the model.

    Arguments

  • Model (Model)

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

    Solid.UnblankAll(m);


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

    Description

    Unblanks all of the flagged solids in the model.

    Arguments

  • Model (Model)

    Model that the flagged solids will be unblanked in

  • flag (Flag)

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

    Solid.UnblankFlagged(m, f);


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

    Description

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

    Arguments

  • Model (Model)

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

  • flag (Flag)

    Flag to unset on the solids

    Returns

    No return value

    Example

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

    Solid.UnflagAll(m, f);


    Unsketch(redraw (optional)[boolean])

    Description

    Unsketches the solid.

    Arguments

  • redraw (optional) (boolean)

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

    Returns

    No return value

    Example

    To unsketch solid s:

    s.Unsketch();


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

    Description

    Unsketches all solids.

    Arguments

  • Model (Model)

    Model that all solids will be unblanked in

  • redraw (optional) (boolean)

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

    Solid.UnsketchAll(m);


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

    Description

    Unsketches all flagged solids in the model.

    Arguments

  • Model (Model)

    Model that all solids will be unsketched in

  • flag (Flag)

    Flag set on the solids that you want to unsketch

  • redraw (optional) (boolean)

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

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

    Solid object.

    Return type

    Solid

    Example

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

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


    Volume()

    Description

    Calculates the volume for the solid

    Arguments

    No arguments

    Returns

    real

    Return type

    Number

    Example

    To calculate the volume for solid s:

    var volume = s.Volume();


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

    Description

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

    s.Warning("My custom warning");


    Warpage()

    Description

    Calculates the warpage for the solid

    Arguments

    No arguments

    Returns

    real

    Return type

    Number

    Example

    To calculate the warpage for solid s:

    var warpage = s.Warpage();


    Xrefs()

    Description

    Returns the cross references for this solid.

    Arguments

    No arguments

    Returns

    Xrefs object.

    Return type

    Xrefs

    Example

    To get the cross references for solid s:

    var xrefs = s.Xrefs();


    toString()

    Description

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

    Arguments

    No arguments

    Returns

    string

    Return type

    String

    Example

    To get data for solid s in keyword format

    var str = s.toString();