Oasys.PRIMER.Solid class

Constants

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

Properties

property Solid.a1: float

x component of material direction a

property Solid.a2: float

y component of material direction a

property Solid.a3: float

z component of material direction a

property Solid.colour: Colour

The colour of the solid

property Solid.d1: float

x component of material in-plane vector

property Solid.d2: float

y component of material in-plane vector

property Solid.d3: float

z component of material in-plane vector

property Solid.dof: boolean

If DOF option is set. Can be true or false

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

property Solid.eid: integer

Solid number. Also see the label property which is an alternative name for this

property Solid.exists(read only): boolean

true if solid exists, false if referred to but not defined

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

property Solid.h20: boolean

If _H20 option is set. Can be true or false

property Solid.h27: boolean

If _H27 option is set. Can be true or false

property Solid.h64: boolean

If _H64 option is set. Can be true or false

property Solid.h8toh20: boolean

If _H8TOH20 option is set. Can be true or false

property Solid.h8toh27: boolean

If _H8TOH27 option is set. Can be true or false

property Solid.h8toh64: boolean

If _H8TOH64 option is set. Can be true or false

property Solid.include: integer

The Include file number that the solid is in

property Solid.label: integer

Solid number. Also see the eid property which is an alternative name for this

property Solid.model(read only): integer

The Model number that the solid is in

property Solid.n1: integer

Node number 1

property Solid.n10: integer

Node number 10

property Solid.n11: integer

Node number 11

property Solid.n12: integer

Node number 12

property Solid.n13: integer

Node number 13

property Solid.n14: integer

Node number 14

property Solid.n15: integer

Node number 15

property Solid.n16: integer

Node number 16

property Solid.n17: integer

Node number 17

property Solid.n18: integer

Node number 18

property Solid.n19: integer

Node number 19

property Solid.n2: integer

Node number 2

property Solid.n20: integer

Node number 20

property Solid.n21: integer

Node number 21

property Solid.n22: integer

Node number 22

property Solid.n23: integer

Node number 23

property Solid.n24: integer

Node number 24

property Solid.n25: integer

Node number 25

property Solid.n26: integer

Node number 26

property Solid.n27: integer

Node number 27

property Solid.n28: integer

Node number 28

property Solid.n29: integer

Node number 29

property Solid.n3: integer

Node number 3

property Solid.n30: integer

Node number 30

property Solid.n31: integer

Node number 31

property Solid.n32: integer

Node number 32

property Solid.n33: integer

Node number 33

property Solid.n34: integer

Node number 34

property Solid.n35: integer

Node number 35

property Solid.n36: integer

Node number 36

property Solid.n37: integer

Node number 37

property Solid.n38: integer

Node number 38

property Solid.n39: integer

Node number 39

property Solid.n4: integer

Node number 4

property Solid.n40: integer

Node number 40

property Solid.n41: integer

Node number 41

property Solid.n42: integer

Node number 42

property Solid.n43: integer

Node number 43

property Solid.n44: integer

Node number 44

property Solid.n45: integer

Node number 45

property Solid.n46: integer

Node number 46

property Solid.n47: integer

Node number 47

property Solid.n48: integer

Node number 48

property Solid.n49: integer

Node number 49

property Solid.n5: integer

Node number 5

property Solid.n50: integer

Node number 50

property Solid.n51: integer

Node number 51

property Solid.n52: integer

Node number 52

property Solid.n53: integer

Node number 53

property Solid.n54: integer

Node number 54

property Solid.n55: integer

Node number 55

property Solid.n56: integer

Node number 56

property Solid.n57: integer

Node number 57

property Solid.n58: integer

Node number 58

property Solid.n59: integer

Node number 59

property Solid.n6: integer

Node number 6

property Solid.n60: integer

Node number 60

property Solid.n61: integer

Node number 61

property Solid.n62: integer

Node number 62

property Solid.n63: integer

Node number 63

property Solid.n64: integer

Node number 64

property Solid.n7: integer

Node number 7

property Solid.n8: integer

Node number 8

property Solid.n9: integer

Node number 9

property Solid.nodes(read only): integer

Number of nodes solid has

property Solid.ns1: integer

Scalar Node number 1

property Solid.ns2: integer

Scalar Node number 2

property Solid.ns3: integer

Scalar Node number 3

property Solid.ns4: integer

Scalar Node number 4

property Solid.ns5: integer

Scalar Node number 5

property Solid.ns6: integer

Scalar Node number 6

property Solid.ns7: integer

Scalar Node number 7

property Solid.ns8: integer

Scalar Node number 8

property Solid.ortho: boolean

If _ORTHO option is set. Can be true or false

property Solid.p21: boolean

If _P21 option is set. Can be true or false

property Solid.p40: boolean

If _P40 option is set. Can be true or false

property Solid.pid: integer

Part number

property Solid.t15: boolean

If _T15 option is set. Can be true or false

property Solid.t20: boolean

If _T20 option is set. Can be true or false

property Solid.tet4totet10: boolean

If _TET4TOTET10 option is set. Can be true or false

property Solid.transparency: integer

The transparency of the solid (0-100) 0% is opaque, 100% is transparent

Constructor

classmethod Solid(model, options)

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

Parameters:
  • model (Model) – Model that solid will be created in

  • options (dict) –

    Options for creating the solid

    eid:

    (integer) Solid number

    nodes:

    (array) List of Node IDs for the solid. At least 4 nodes must be given

    pid:

    (integer) Part number

Returns:

Solid object

Return type:

dict

Example

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

s = Oasys.PRIMER.Solid(m, {'eid': 100, 'pid': 10, 'nodes': [1,2,3,4]} )

Static methods

classmethod Solid.BlankAll(model, redraw=Oasys.gRPC.defaultArg)

Blanks all of the solids in the model

Parameters:
  • model (Model) – Model that all solids will be blanked in

  • redraw (boolean) – Optional. 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

Return type:

None

Example

To blank all of the solids in model m:

Oasys.PRIMER.Solid.BlankAll(m)
classmethod Solid.BlankFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)

Blanks all of the flagged solids in the model

Parameters:
  • 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 (boolean) – Optional. 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

Return type:

None

Example

To blank all of the solids in model m flagged with f:

Oasys.PRIMER.Solid.BlankFlagged(m, f)
classmethod Solid.CoordsToIsoparametric(model, x, y, z, n1, n2, n3, n4)

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

Parameters:
  • model (Model) – Model designated model

  • x (float) – X coordinate of point

  • y (float) – Y coordinate of point

  • z (float) – 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:

List 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 None is returned

Return type:

list

Example

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

isocoords = Oasys.PRIMER.Solid.CoordsToIsoparametric(100, 100, 20, 11, 12, 13, 14)
classmethod Solid.Create(model, modal=Oasys.gRPC.defaultArg)

Starts an interactive editing panel to create a solid

Parameters:
  • model (Model) – Model that the solid will be created in

  • modal (boolean) – Optional. 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 None if not made)

Return type:

dict

Example

To start creating a solid in model m:

s = Oasys.PRIMER.Solid.Create(m)
classmethod Solid.FindSolidInBox(model, xmin, xmax, ymin, ymax, zmin, zmax, flag=Oasys.gRPC.defaultArg, excl=Oasys.gRPC.defaultArg, vis_only=Oasys.gRPC.defaultArg)

Returns a list 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

Parameters:
  • 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 (integer) – Optional. Optional flag to restrict solids considered, if 0 all solids considered

  • excl (integer) – Optional. 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 (integer) – Optional. Optional flag to consider visible elements only (1), if (0) all elements considered

Returns:

List of Solid objects

Return type:

list

Example

To get a list of Solid objects for flagged solids within defined box (inclusive selection)

s = Oasys.PRIMER.Solid.FindSolidInBox(m, xmin, xmax, ymin, ymax, zmin, zmax, flag, 0, 0)
classmethod Solid.First(model)

Returns the first solid in the model

Parameters:

model (Model) – Model to get first solid in

Returns:

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

Return type:

Solid

Example

To get the first solid in model m:

s = Oasys.PRIMER.Solid.First(m)
classmethod Solid.FirstFreeLabel(model, layer=Oasys.gRPC.defaultArg)

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

Parameters:
  • model (Model) – Model to get first free solid label in

  • layer (Include number) – Optional. 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:

int

Example

To get the first free solid label in model m:

label = Oasys.PRIMER.Solid.FirstFreeLabel(m)
classmethod Solid.FlagAll(model, flag)

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

Parameters:
  • model (Model) – Model that all solids will be flagged in

  • flag (Flag) – Flag to set on the solids

Returns:

No return value

Return type:

None

Example

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

Oasys.PRIMER.Solid.FlagAll(m, f)
classmethod Solid.GetAll(model)

Returns a list of Solid objects for all of the solids in a model in PRIMER

Parameters:

model (Model) – Model to get solids from

Returns:

List of Solid objects

Return type:

list

Example

To make a list of Solid objects for all of the solids in model m

s = Oasys.PRIMER.Solid.GetAll(m)
classmethod Solid.GetFlagged(model, flag)

Returns a list of Solid objects for all of the flagged solids in a model in PRIMER

Parameters:
  • model (Model) – Model to get solids from

  • flag (Flag) – Flag set on the solids that you want to retrieve

Returns:

List of Solid objects

Return type:

list

Example

To make a list of Solid objects for all of the solids in model m flagged with f

s = Oasys.PRIMER.Solid.GetFlagged(m, f)
classmethod Solid.GetFromID(model, number)

Returns the Solid object for a solid ID

Parameters:
  • model (Model) – Model to find the solid in

  • number (integer) – number of the solid you want the Solid object for

Returns:

Solid object (or None if solid does not exist)

Return type:

Solid

Example

To get the Solid object for solid 100 in model m

s = Oasys.PRIMER.Solid.GetFromID(m, 100)
classmethod Solid.Last(model)

Returns the last solid in the model

Parameters:

model (Model) – Model to get last solid in

Returns:

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

Return type:

Solid

Example

To get the last solid in model m:

s = Oasys.PRIMER.Solid.Last(m)
classmethod Solid.LastFreeLabel(model, layer=Oasys.gRPC.defaultArg)

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

Parameters:
  • model (Model) – Model to get last free solid label in

  • layer (Include number) – Optional. 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:

int

Example

To get the last free solid label in model m:

label = Oasys.PRIMER.Solid.LastFreeLabel(m)
classmethod Solid.NextFreeLabel(model, layer=Oasys.gRPC.defaultArg)

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

Parameters:
  • model (Model) – Model to get next free solid label in

  • layer (Include number) – Optional. 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:

int

Example

To get the next free solid label in model m:

label = Oasys.PRIMER.Solid.NextFreeLabel(m)
classmethod Solid.Pick(prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg, button_text=Oasys.gRPC.defaultArg)

Allows the user to pick a solid

Parameters:
  • prompt (string) – Text to display as a prompt to the user

  • limit (Model or Flag) – Optional. 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 None, any solids from any model can be selected. from any model

  • modal (boolean) – Optional. 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 (string) – Optional. By default the window with the prompt will have a button labelled ‘Cancel’ which if pressed will cancel the pick and return None. If you want to change the text on the button use this argument. If omitted ‘Cancel’ will be used

Returns:

Solid object (or None if not picked)

Return type:

dict

Example

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

s = Oasys.PRIMER.Solid.Pick('Pick solid from screen', m)
classmethod Solid.RenumberAll(model, start)

Renumbers all of the solids in the model

Parameters:
  • model (Model) – Model that all solids will be renumbered in

  • start (integer) – Start point for renumbering

Returns:

No return value

Return type:

None

Example

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

Oasys.PRIMER.Solid.RenumberAll(m, 1000000)
classmethod Solid.RenumberFlagged(model, flag, start)

Renumbers all of the flagged solids in the model

Parameters:
  • 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

Return type:

None

Example

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

Oasys.PRIMER.Solid.RenumberFlagged(m, f, 1000000)
classmethod Solid.Select(flag, prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg)

Allows the user to select solids using standard PRIMER object menus

Parameters:
  • flag (Flag) – Flag to use when selecting solids

  • prompt (string) – Text to display as a prompt to the user

  • limit (Model or Flag) – Optional. 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 None, any solids can be selected. from any model

  • modal (boolean) – Optional. 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 None if menu cancelled

Return type:

int

Example

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

Oasys.PRIMER.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’:

Oasys.PRIMER.Solid.Select(f, 'Select solids', l)
classmethod Solid.SketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)

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

Parameters:
  • 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 (boolean) – Optional. 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

Return type:

None

Example

To sketch all solids flagged with flag in model m:

Oasys.PRIMER.Solid.SketchFlagged(m, flag)
classmethod Solid.Total(model, exists=Oasys.gRPC.defaultArg)

Returns the total number of solids in the model

Parameters:
  • model (Model) – Model to get total for

  • exists (boolean) – Optional. 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:

int

Example

To get the total number of solids in model m:

total = Oasys.PRIMER.Solid.Total(m)
classmethod Solid.UnblankAll(model, redraw=Oasys.gRPC.defaultArg)

Unblanks all of the solids in the model

Parameters:
  • model (Model) – Model that all solids will be unblanked in

  • redraw (boolean) – Optional. 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

Return type:

None

Example

To unblank all of the solids in model m:

Oasys.PRIMER.Solid.UnblankAll(m)
classmethod Solid.UnblankFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)

Unblanks all of the flagged solids in the model

Parameters:
  • model (Model) – Model that the flagged solids will be unblanked in

  • flag (Flag) – Flag set on the solids that you want to unblank

  • redraw (boolean) – Optional. 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

Return type:

None

Example

To unblank all of the solids in model m flagged with f:

Oasys.PRIMER.Solid.UnblankFlagged(m, f)
classmethod Solid.UnflagAll(model, flag)

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

Parameters:
  • 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

Return type:

None

Example

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

Oasys.PRIMER.Solid.UnflagAll(m, f)
classmethod Solid.UnsketchAll(model, redraw=Oasys.gRPC.defaultArg)

Unsketches all solids

Parameters:
  • model (Model) – Model that all solids will be unblanked in

  • redraw (boolean) – Optional. 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

Return type:

None

Example

To unsketch all solids in model m:

Oasys.PRIMER.Solid.UnsketchAll(m)
classmethod Solid.UnsketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)

Unsketches all flagged solids in the model

Parameters:
  • model (Model) – Model that all solids will be unsketched in

  • flag (Flag) – Flag set on the solids that you want to unsketch

  • redraw (boolean) – Optional. 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

Return type:

None

Example

To unsketch all solids flagged with flag in model m:

Oasys.PRIMER.Solid.UnsketchAll(m, flag)

Instance methods

Solid.AspectRatio()

Calculates the aspect ratio for the solid

Returns:

float

Return type:

float

Example

To calculate the aspect ratio for solid s:

ratio = s.AspectRatio()
Solid.AssociateComment(comment)

Associates a comment with a solid

Parameters:

comment (Comment) – Comment that will be attached to the solid

Returns:

No return value

Return type:

None

Example

To associate comment c to the solid s:

s.AssociateComment(c)
Solid.Blank()

Blanks the solid

Returns:

No return value

Return type:

None

Example

To blank solid s:

s.Blank()
Solid.Blanked()

Checks if the solid is blanked or not

Returns:

True if blanked, False if not

Return type:

bool

Example

To check if solid s is blanked:

if s.Blanked():
    do_something..
Solid.Browse(modal=Oasys.gRPC.defaultArg)

Starts an edit panel in Browse mode

Parameters:

modal (boolean) – Optional. 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

Return type:

None

Example

To Browse solid s:

s.Browse()
Solid.ClearFlag(flag)

Clears a flag on the solid

Parameters:

flag (Flag) – Flag to clear on the solid

Returns:

No return value

Return type:

None

Example

To clear flag f for solid s:

s.ClearFlag(f)
Solid.Copy(range=Oasys.gRPC.defaultArg)

Copies the solid. The target include of the copied solid can be set using Options.copy_target_include

Parameters:

range (boolean) – Optional. 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:

z = s.Copy()
Solid.DetachComment(comment)

Detaches a comment from a solid

Parameters:

comment (Comment) – Comment that will be detached from the solid

Returns:

No return value

Return type:

None

Example

To detach comment c from the solid s:

s.DetachComment(c)
Solid.Edit(modal=Oasys.gRPC.defaultArg)

Starts an interactive editing panel

Parameters:

modal (boolean) – Optional. 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

Return type:

None

Example

To Edit solid s:

s.Edit()
Solid.ElemCut(database_cross_section_label)

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

Parameters:

database_cross_section_label (integer) – The label of the database cross section

Returns:

Dict with properties

face1:

(List of reals) An list containing the x1,y1,z1,x2,y2,z2 coordinates of the cut line on the face 1. None if no cut on this face

face2:

(List of reals) An list containing the x1,y1,z1,x2,y2,z2 coordinates of the cut line on the face 2. None if no cut on this face

face3:

(List of reals) An list containing the x1,y1,z1,x2,y2,z2 coordinates of the cut line on the face 3. None if no cut on this face

face4:

(List of reals) An list containing the x1,y1,z1,x2,y2,z2 coordinates of the cut line on the face 4. None if no cut on this face

face5:

(List of reals) An list containing the x1,y1,z1,x2,y2,z2 coordinates of the cut line on the face 5. None if no cut on this face

face6:

(List of reals) An list containing the x1,y1,z1,x2,y2,z2 coordinates of the cut line on the face 6. None if no cut on this face

Return type:

dict

Example

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

data = s.ElemCut(200)
face = data["face3"]
if(face):
    point1_x = face[0]
    point1_y = face[1]
    point1_z = face[2]
    point2_x = face[3]
    point2_y = face[4]
    point2_z = face[5]
Solid.ExtractColour()

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

Returns:

colour value (integer)

Return type:

int

Example

To return the colour used for drawing solid s:

colour = s.ExtractColour()
Solid.Flagged(flag)

Checks if the solid is flagged or not

Parameters:

flag (Flag) – Flag to test on the solid

Returns:

True if flagged, False if not

Return type:

bool

Example

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

if s.Flagged(f):
    do_something..
Solid.GetComments()

Extracts the comments associated to a solid

Returns:

List of Comment objects (or None if there are no comments associated to the node)

Return type:

list

Example

To get the list of comments associated to the solid s:

comm_list = s.GetComments()
Solid.GetParameter(prop)

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)

Parameters:

prop (string) – solid property to get parameter for

Returns:

Parameter object if property is a parameter, None if not

Return type:

dict

Example

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

Oasys.PRIMER.Options.property_parameter_names = True
if s.GetParameter(s.example):
    do_something...
Oasys.PRIMER.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..
Solid.Jacobian()

Calculates the jacobian for the solid

Returns:

float

Return type:

float

Example

To calculate the jacobian for solid s:

jacobian = s.Jacobian()
Solid.Keyword()

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()

Returns:

string containing the keyword

Return type:

str

Example

To get the keyword for solid s:

key = s.Keyword()
Solid.KeywordCards()

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

Returns:

string containing the cards

Return type:

str

Example

To get the cards for solid s:

cards = s.KeywordCards()
Solid.Next()

Returns the next solid in the model

Returns:

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

Return type:

Solid

Example

To get the solid in model m after solid s:

s = s.Next()
Solid.Previous()

Returns the previous solid in the model

Returns:

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

Return type:

Solid

Example

To get the solid in model m before solid s:

s = s.Previous()
Solid.SetFlag(flag)

Sets a flag on the solid

Parameters:

flag (Flag) – Flag to set on the solid

Returns:

No return value

Return type:

None

Example

To set flag f for solid s:

s.SetFlag(f)
Solid.Sketch(redraw=Oasys.gRPC.defaultArg)

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

Parameters:

redraw (boolean) – Optional. 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

Return type:

None

Example

To sketch solid s:

s.Sketch()
Solid.TetCollapse()

Calculates the tetrahedral collapse for the solid

Returns:

float

Return type:

float

Example

To calculate the tet collapse for solid s:

collapse = s.TetCollapse()
Solid.TiedNodeCheck(contact_label, flag, option1, option2)

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

Parameters:
  • 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:

str

Example

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

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

Calculates the timestep for the solid

Returns:

float

Return type:

float

Example

To calculate the timestep for solid s:

timestep = s.Timestep()
Solid.Unblank()

Unblanks the solid

Returns:

No return value

Return type:

None

Example

To unblank solid s:

s.Unblank()
Solid.Unsketch(redraw=Oasys.gRPC.defaultArg)

Unsketches the solid

Parameters:

redraw (boolean) – Optional. 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

Return type:

None

Example

To unsketch solid s:

s.Unsketch()
Solid.ViewParameters()

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

Returns:

Solid object

Return type:

dict

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..
Solid.Volume()

Calculates the volume for the solid

Returns:

float

Return type:

float

Example

To calculate the volume for solid s:

volume = s.Volume()
Solid.Warpage()

Calculates the warpage for the solid

Returns:

float

Return type:

float

Example

To calculate the warpage for solid s:

warpage = s.Warpage()
Solid.Xrefs()

Returns the cross references for this solid

Returns:

Xrefs object

Return type:

dict

Example

To get the cross references for solid s:

xrefs = s.Xrefs()