Oasys.PRIMER.Shell class¶
Constants¶
Properties¶
- property Shell.beta: float¶
Orthotropic material base offset angle. None 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
- property Shell.colour: Colour¶
The colour of the shell
- property Shell.composite: boolean¶
If COMPOSITE option is set. Can be true or false
- property Shell.composite_long: boolean¶
If COMPOSITE_LONG option is set. Can be true or false
- property Shell.dof: boolean¶
If DOF option is set. Can be true or false
- property Shell.edges: constant¶
Bitwise code of
Shell.EDGE_1
,Shell.EDGE_2
,Shell.EDGE_3
andShell.EDGE_4
representing which edges of the shell are free edges
- property Shell.eid: integer¶
Shell
number. Also see thelabel
property which is an alternative name for this
- property Shell.exists(read only): boolean¶
true if shell exists, false if referred to but not defined
- property Shell.label: integer¶
Shell
number. Also see theeid
property which is an alternative name for this
- property Shell.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 None.
- property Shell.nodes(read only): integer¶
Number of nodes shell has
- property Shell.offset: float¶
Offset distance. If non zero then the _OFFSET option is assumed
- property Shell.shl4_to_shl8: boolean¶
If SHL4_TO_SHL8 option is set. Can be true or false
- property Shell.thic1: float¶
Thickness at node 1
- property Shell.thic2: float¶
Thickness at node 2
- property Shell.thic3: float¶
Thickness at node 3
- property Shell.thic4: float¶
Thickness at node 4
- property Shell.thic5: float¶
Thickness at node 5 (if 8 noded shell)
- property Shell.thic6: float¶
Thickness at node 6 (if 8 noded shell)
- property Shell.thic7: float¶
Thickness at node 7 (if 8 noded shell)
- property Shell.thic8: float¶
Thickness at node 8 (if 8 noded shell)
- property Shell.thickness: boolean¶
If _THICKNESS option is set. Can be true or false
- property Shell.transparency: integer¶
The transparency of the shell (0-100) 0% is opaque, 100% is transparent
Constructor¶
- classmethod Shell(model, eid, pid, n1, n2, n3, n4=Oasys.gRPC.defaultArg, n5=Oasys.gRPC.defaultArg, n6=Oasys.gRPC.defaultArg, n7=Oasys.gRPC.defaultArg, n8=Oasys.gRPC.defaultArg)¶
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
- Parameters:
model (Model) –
Model
that shell will be created ineid (integer) –
Shell
numberpid (integer) –
Part
numbern1 (integer) –
Node
number 1n2 (integer) –
Node
number 2n3 (integer) –
Node
number 3n4 (integer) – Optional.
Node
number 4n5 (integer) – Optional.
Node
number 5n6 (integer) – Optional.
Node
number 6n7 (integer) – Optional.
Node
number 7n8 (integer) – Optional.
Node
number 8- Returns:
Shell object
- Return type:
dict
Example
To create a new shell in model m with label 100, part 10 and nodes 1, 2, 3, 4:
s = Oasys.PRIMER.Shell(m, 100, 10, 1, 2, 3, 4)
Static methods¶
- classmethod Shell.BlankAll(model, redraw=Oasys.gRPC.defaultArg)¶
Blanks all of the shells in the model
- Parameters:
model (Model) –
Model
that all shells will be blanked inredraw (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 shells in model m:
Oasys.PRIMER.Shell.BlankAll(m)
- classmethod Shell.BlankFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Blanks all of the flagged shells in the model
- Parameters:
model (Model) –
Model
that all the flagged shells will be blanked inflag (Flag) – Flag set on the shells 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 shells in model m flagged with f:
Oasys.PRIMER.Shell.BlankFlagged(m, f)
- classmethod Shell.Create(model, modal=Oasys.gRPC.defaultArg)¶
Starts an interactive editing panel to create a shell
- Parameters:
model (Model) –
Model
that the shell will be created inmodal (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:
Shell object (or None if not made)
- Return type:
dict
Example
To start creating a shell in model m:
s = Oasys.PRIMER.Shell.Create(m)
- classmethod Shell.FillHolesOnFlagged(model, flag, remeshhole, pid=Oasys.gRPC.defaultArg, max_hole_size=Oasys.gRPC.defaultArg, mesh_element_size=Oasys.gRPC.defaultArg, planarsurface=Oasys.gRPC.defaultArg)¶
Fills multiple holes using flagged shells
- Parameters:
model (Model) –
Model
that all shells are inflag (Flag) – flag bit
remeshhole (boolean) – TRUE if elements around the hole should be remeshed
pid (integer) – Optional. Needs to be specified if RemeshHole is FALSE. Specifies the Part id where the mesh is filled
max_hole_size (float) – Optional. Maximum size of the hole which is to be filled. If omitted a default size of 20.0 will be set
mesh_element_size (float) – Optional. Element size of the mesh which fills the hole. If omitted a default size of 10.0 will be set
planarsurface (boolean) – Optional. Needs to be specified if RemeshHole is TRUE. TRUE if we need to Use planar surface
- Returns:
No return value
- Return type:
None
Example
To fill holes on flagged shells:
Oasys.PRIMER.Shell.FillHolesOnFlagged(m, flag, 1, 112, 60.5, 5.34 ,0)Note: pid is required when RemeshHole is FALSE
Oasys.PRIMER.Shell.FillHolesOnFlagged(m, flag, 0, 112)
- classmethod Shell.FindShellInBox(model, xmin, xmax, ymin, ymax, zmin, zmax, flag=Oasys.gRPC.defaultArg, excl=Oasys.gRPC.defaultArg, vis_only=Oasys.gRPC.defaultArg)¶
Returns a list 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
- Parameters:
model (Model) –
Model
designated modelxmin (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 shells considered, if 0 all shells considered
excl (integer) – Optional. 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 (integer) – Optional. Optional flag to consider visible shells only (1), if (0) all shells considered
- Returns:
List of Shell objects
- Return type:
list
Example
To get a list of Shell objects for flagged shells within defined box
s = Oasys.PRIMER.Shell.FindShellInBox(m, xmin, xmax, ymin, ymax, zmin, zmax, flag, 0, 0)
- classmethod Shell.First(model)¶
Returns the first shell in the model
- Parameters:
model (Model) –
Model
to get first shell in- Returns:
Shell object (or None if there are no shells in the model)
- Return type:
Shell
Example
To get the first shell in model m:
s = Oasys.PRIMER.Shell.First(m)
- classmethod Shell.FirstFreeLabel(model, layer=Oasys.gRPC.defaultArg)¶
Returns the first free shell label in the model. Also see
Shell.LastFreeLabel()
,Shell.NextFreeLabel()
andModel.FirstFreeItemLabel()
- Parameters:
- Returns:
Shell label
- Return type:
int
Example
To get the first free shell label in model m:
label = Oasys.PRIMER.Shell.FirstFreeLabel(m)
- classmethod Shell.FlagAll(model, flag)¶
Flags all of the shells in the model with a defined flag
- Parameters:
model (Model) –
Model
that all shells will be flagged inflag (Flag) – Flag to set on the shells
- Returns:
No return value
- Return type:
None
Example
To flag all of the shells with flag f in model m:
Oasys.PRIMER.Shell.FlagAll(m, f)
- classmethod Shell.GetAll(model)¶
Returns a list of Shell objects for all of the shells in a model in PRIMER
- Parameters:
model (Model) –
Model
to get shells from- Returns:
List of Shell objects
- Return type:
list
Example
To make a list of Shell objects for all of the shells in model m
s = Oasys.PRIMER.Shell.GetAll(m)
- classmethod Shell.GetFlagged(model, flag)¶
Returns a list of Shell objects for all of the flagged shells in a model in PRIMER
- Parameters:
model (Model) –
Model
to get shells fromflag (Flag) – Flag set on the shells that you want to retrieve
- Returns:
List of Shell objects
- Return type:
list
Example
To make a list of Shell objects for all of the shells in model m flagged with f
s = Oasys.PRIMER.Shell.GetFlagged(m, f)
- classmethod Shell.GetFromID(model, number)¶
Returns the Shell object for a shell ID
- Parameters:
model (Model) –
Model
to find the shell innumber (integer) – number of the shell you want the Shell object for
- Returns:
Shell object (or None if shell does not exist)
- Return type:
Shell
Example
To get the Shell object for shell 100 in model m
s = Oasys.PRIMER.Shell.GetFromID(m, 100)
- classmethod Shell.Last(model)¶
Returns the last shell in the model
- Parameters:
model (Model) –
Model
to get last shell in- Returns:
Shell object (or None if there are no shells in the model)
- Return type:
Shell
Example
To get the last shell in model m:
s = Oasys.PRIMER.Shell.Last(m)
- classmethod Shell.LastFreeLabel(model, layer=Oasys.gRPC.defaultArg)¶
Returns the last free shell label in the model. Also see
Shell.FirstFreeLabel()
,Shell.NextFreeLabel()
and seeModel.LastFreeItemLabel()
- Parameters:
- Returns:
Shell label
- Return type:
int
Example
To get the last free shell label in model m:
label = Oasys.PRIMER.Shell.LastFreeLabel(m)
- classmethod Shell.MakeConsistentNormalsFlagged(model, flag, shell_label=Oasys.gRPC.defaultArg)¶
Make all the flagged SHELL normals consistent with a selected one, the Seed Element
- Parameters:
model (Model) –
Model
that all shells are inflag (Flag) – flag bit
shell_label (integer) – Optional. The label of the seed shell. If omitted, or None, the first flagged shell is used as the seed shell
- Returns:
List containing the labels of shells which have had normals reversed
- Return type:
list
Example
To make all flagged shell normals consistent:
Oasys.PRIMER.Shell.MakeConsistentNormalsFlagged(m, flag, 1001)
- classmethod Shell.NextFreeLabel(model, layer=Oasys.gRPC.defaultArg)¶
Returns the next free (highest+1) shell label in the model. Also see
Shell.FirstFreeLabel()
,Shell.LastFreeLabel()
andModel.NextFreeItemLabel()
- Parameters:
- Returns:
Shell label
- Return type:
int
Example
To get the next free shell label in model m:
label = Oasys.PRIMER.Shell.NextFreeLabel(m)
- classmethod Shell.Pick(prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg, button_text=Oasys.gRPC.defaultArg)¶
Allows the user to pick a shell
- 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 shells from that model can be picked. If the argument is aFlag
then only shells that are flagged with limit can be selected. If omitted, or None, any shells from any model can be selected. from any modelmodal (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:
Shell object (or None if not picked)
- Return type:
dict
Example
To pick a shell from model m giving the prompt ‘Pick shell from screen’:
s = Oasys.PRIMER.Shell.Pick('Pick shell from screen', m)
- classmethod Shell.PickIsoparametric(prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg, button_text=Oasys.gRPC.defaultArg)¶
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 alsoShell.Pick()
- 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 shells from that model can be picked. If the argument is aFlag
then only shells that are flagged with limit can be selected. If omitted, or None, any shells from any model can be selected. from any modelmodal (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:
List containing Shell object and isoparametric coordinates (or None if not picked or the point is not on a shell)
- Return type:
list
Example
To pick a point on a shell from model m giving the prompt ‘Pick a point on a shell on the screen’:
a = Oasys.PRIMER.Shell.PickIsoparametric('Pick a point on a shell on the screen', m) if (a != None): print("You picked point ", a[1], ",", a[2], " on shell ", a[0].label)
- classmethod Shell.RenumberAll(model, start)¶
Renumbers all of the shells in the model
- Parameters:
model (Model) –
Model
that all shells will be renumbered instart (integer) – Start point for renumbering
- Returns:
No return value
- Return type:
None
Example
To renumber all of the shells in model m, from 1000000:
Oasys.PRIMER.Shell.RenumberAll(m, 1000000)
- classmethod Shell.RenumberFlagged(model, flag, start)¶
Renumbers all of the flagged shells in the model
- Parameters:
model (Model) –
Model
that all the flagged shells will be renumbered inflag (Flag) – Flag set on the shells that you want to renumber
start (integer) – Start point for renumbering
- Returns:
No return value
- Return type:
None
Example
To renumber all of the shells in model m flagged with f, from 1000000:
Oasys.PRIMER.Shell.RenumberFlagged(m, f, 1000000)
- classmethod Shell.ReverseNormalsFlagged(model, flag)¶
Reverse all the flagged shell normals
- Parameters:
model (Model) –
Model
that all shells are inflag (Flag) – flag bit
- Returns:
No return value
- Return type:
None
Example
To Reverse all flagged shell normals:
Oasys.PRIMER.Shell.ReverseNormalsFlagged(m, flag)
- classmethod Shell.Select(flag, prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg)¶
Allows the user to select shells using standard PRIMER object menus
- Parameters:
flag (Flag) – Flag to use when selecting shells
prompt (string) – Text to display as a prompt to the user
limit (Model or Flag) – Optional. If the argument is a
Model
then only shells from that model can be selected. If the argument is aFlag
then only shells that are flagged with limit can be selected (limit should be different to flag). If omitted, or None, any shells can be selected. from any modelmodal (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 shells selected or None if menu cancelled
- Return type:
int
Example
To select shells from model m, flagging those selected with flag f, giving the prompt ‘Select shells’:
Oasys.PRIMER.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’:
Oasys.PRIMER.Shell.Select(f, 'Select shells', l)
- classmethod Shell.SketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
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
- Parameters:
model (Model) –
Model
that all the flagged shells will be sketched inflag (Flag) – Flag set on the shells that you want to sketch
redraw (boolean) – Optional. 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
- Return type:
None
Example
To sketch all shells flagged with flag in model m:
Oasys.PRIMER.Shell.SketchFlagged(m, flag)
- classmethod Shell.Total(model, exists=Oasys.gRPC.defaultArg)¶
Returns the total number of shells in the model
- Parameters:
model (Model) –
Model
to get total forexists (boolean) – Optional. 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:
int
Example
To get the total number of shells in model m:
total = Oasys.PRIMER.Shell.Total(m)
- classmethod Shell.UnblankAll(model, redraw=Oasys.gRPC.defaultArg)¶
Unblanks all of the shells in the model
- Parameters:
model (Model) –
Model
that all shells will be unblanked inredraw (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 shells in model m:
Oasys.PRIMER.Shell.UnblankAll(m)
- classmethod Shell.UnblankFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Unblanks all of the flagged shells in the model
- Parameters:
model (Model) –
Model
that the flagged shells will be unblanked inflag (Flag) – Flag set on the shells 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 shells in model m flagged with f:
Oasys.PRIMER.Shell.UnblankFlagged(m, f)
- classmethod Shell.UnflagAll(model, flag)¶
Unsets a defined flag on all of the shells in the model
- Parameters:
model (Model) –
Model
that the defined flag for all shells will be unset inflag (Flag) – Flag to unset on the shells
- Returns:
No return value
- Return type:
None
Example
To unset the flag f on all the shells in model m:
Oasys.PRIMER.Shell.UnflagAll(m, f)
- classmethod Shell.UnsketchAll(model, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all shells
- Parameters:
model (Model) –
Model
that all shells will be unblanked inredraw (boolean) – Optional. 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
- Return type:
None
Example
To unsketch all shells in model m:
Oasys.PRIMER.Shell.UnsketchAll(m)
- classmethod Shell.UnsketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all flagged shells in the model
- Parameters:
model (Model) –
Model
that all shells will be unsketched inflag (Flag) – Flag set on the shells that you want to unsketch
redraw (boolean) – Optional. 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
- Return type:
None
Example
To unsketch all shells flagged with flag in model m:
Oasys.PRIMER.Shell.UnsketchAll(m, flag)
Instance methods¶
- Shell.Angles()¶
Calculates the minimum and maximum internal angles (in degrees) for the shell
- Returns:
List of numbers containing min and max angles
- Return type:
int
Example
To calculate the maximum and minimum internal angles for shell s:
angles = s.Angles() min = angles[0] max = angles[1]
- Shell.Area()¶
Calculates the area for the shell
- Returns:
float
- Return type:
float
Example
To calculate the area for shell s:
area = s.Area()
- Shell.AspectRatio()¶
Calculates the aspect ratio for the shell
- Returns:
float
- Return type:
float
Example
To calculate the aspect ratio for shell s:
ratio = s.AspectRatio()
- Shell.AssociateComment(comment)¶
Associates a comment with a shell
- Parameters:
comment (Comment) –
Comment
that will be attached to the shell- Returns:
No return value
- Return type:
None
Example
To associate comment c to the shell s:
s.AssociateComment(c)
- Shell.Blank()¶
Blanks the shell
- Returns:
No return value
- Return type:
None
Example
To blank shell s:
s.Blank()
- Shell.Blanked()¶
Checks if the shell is blanked or not
- Returns:
True if blanked, False if not
- Return type:
bool
Example
To check if shell s is blanked:
if s.Blanked(): do_something..
- Shell.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 shell s:
s.Browse()
- Shell.ClearFlag(flag)¶
Clears a flag on the shell
- Parameters:
flag (Flag) – Flag to clear on the shell
- Returns:
No return value
- Return type:
None
Example
To clear flag f for shell s:
s.ClearFlag(f)
- Shell.CoordsToIsoparametric(x, y, z)¶
Calculates the isoparametric coordinates for a point on the shell
- Parameters:
x (float) – X coordinate of point
y (float) – Y coordinate of point
z (float) – Z coordinate of point
- Returns:
List 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 None is returned
- Return type:
list
Example
To calculate the isoparametric coordinates of point (10, 20, 30) on shell s:
isocoords = s.CoordsToIsoparametric(10, 20, 30)
- Shell.Copy(range=Oasys.gRPC.defaultArg)¶
Copies the shell. The target include of the copied shell 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:
Shell object
- Return type:
Shell
Example
To copy shell s into shell z:
z = s.Copy()
- Shell.DetachComment(comment)¶
Detaches a comment from a shell
- Parameters:
comment (Comment) –
Comment
that will be detached from the shell- Returns:
No return value
- Return type:
None
Example
To detach comment c from the shell s:
s.DetachComment(c)
- Shell.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 shell s:
s.Edit()
- Shell.ElemCut(database_cross_section_label)¶
Returns coordinates of the intersections between a shell and a database cross section
- Parameters:
database_cross_section_label (integer) – The label of the database cross section
- Returns:
A list containing the x1,y1,z1,x2,y2,z2 coordinates of the cut line, or None if it does not cut. Note this function does not check that the shell is in the cross section definition (part set)
- Return type:
list
Example
To get the cut line coordinates between database cross section 200 and shell s:
data = s.ElemCut(200)
- Shell.ExtractColour()¶
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 shellcolour
property will return the valueColour.PART
instead of the actual colour. This method will return the actual colour which is used for drawing the shell
- Returns:
colour value (integer)
- Return type:
int
Example
To return the colour used for drawing shell s:
colour = s.ExtractColour()
- Shell.FillAttachedHole(pid, size)¶
Fills in (meshes) a hole attached to the shell
- Parameters:
pid (integer) – The
Part
number that the new shells will be created insize (float) – The size for created elements
- Returns:
No return value
- Return type:
None
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)
- Shell.Flagged(flag)¶
Checks if the shell is flagged or not
- Parameters:
flag (Flag) – Flag to test on the shell
- Returns:
True if flagged, False if not
- Return type:
bool
Example
To check if shell s has flag f set on it:
if s.Flagged(f): do_something..
- Shell.GetAttachedShells(tolerance=Oasys.gRPC.defaultArg, recursive=Oasys.gRPC.defaultArg)¶
Returns the shells that are attached to the shell. Note that ‘attached’ means that the shells must share 2 nodes
- Parameters:
tolerance (float) – Optional. 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 (boolean) – Optional. 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:
List of Shell objects (or None if there are no attached shells)
- Return type:
list
Example
To find the shells attached to shell s with a 10 degree tolerance, growing the selection until no more shells can be found:
shell_list = s.GetAttachedShells(10, True)
- Shell.GetComments()¶
Extracts the comments associated to a shell
- 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 shell s:
comm_list = s.GetComments()
- Shell.GetCompositeData(ipt)¶
Returns the composite data for an integration point in *ELEMENT_SHELL_COMPOSITE
- Parameters:
ipt (integer) – The integration point you want the data for. Note that integration points start at 0, not 1
- Returns:
A list containing the material ID, thickness and beta angle values. If the _COMPOSITE_LONG option is set, then the list returned will also contain the ply ID
- Return type:
list
Example
To get the composite data for the 3rd integration point for shell s:
if (s.composite and s.nip >= 3): ipt_data = s.GetCompositeData(2)
- Shell.GetNodeIDs()¶
Returns the labels of the nodes on the shell as a list. See also
Shell.GetNodes()
- Returns:
List of node labels (integers)
- Return type:
int
Example
To return the node labels of shell s as a list
nodes = s.GetNodeIDs()
- Shell.GetNodes()¶
Returns the nodes on the shell as a list of
Node
objects. See alsoShell.GetNodeIDs()
- Returns:
List of Node objects
- Return type:
list
Example
To return the nodes of shell s as a list
nodes = s.GetNodes()
- Shell.GetParameter(prop)¶
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 theShell.ViewParameters()
method and ‘method chaining’ (see the examples below)
- Parameters:
prop (string) – shell property to get parameter for
- Returns:
Parameter object if property is a parameter, None if not
- Return type:
dict
Example
To check if Shell 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 = FalseTo check if Shell property s.example is a parameter by using the GetParameter method:
if s.ViewParameters().GetParameter(s.example): do_something..
- Shell.GetShellReferenceGeometry()¶
Returns the airbag shell reference geometry of the shell
- Returns:
The shell reference geometry ID of the shell (or 0 if it hasn’t got any)
- Return type:
int
Example
To get the shell reference geometry of the shell s:
a = s.GetShellReferenceGeometry()
- Shell.IsoparametricToCoords(s, t)¶
Calculates the coordinates for a point on the shell from the isoparametric coords
- Parameters:
s (float) – First isoparametric coordinate
t (float) – Second isoparametric coordinate
- Returns:
List of numbers containing x, y and z or None if not possible to calculate
- Return type:
int
Example
To calculate the coordinates of isoparametric point (0.5, -0.5) on shell s:
coords = s.IsoparametricToCoords(0.5, -0.5)
- Shell.Jacobian()¶
Calculates the jacobian for the shell
- Returns:
float
- Return type:
float
Example
To calculate the jacobian for shell s:
jacobian = s.Jacobian()
- Shell.Keyword()¶
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()
- Returns:
string containing the keyword
- Return type:
str
Example
To get the keyword for shell s:
key = s.Keyword()
- Shell.KeywordCards()¶
Returns the keyword cards for the shell. Note that a carriage return is not added. See also
Shell.Keyword()
- Returns:
string containing the cards
- Return type:
str
Example
To get the cards for shell s:
cards = s.KeywordCards()
- Shell.Length()¶
Calculates the minimum length for the shell
- Returns:
float
- Return type:
float
Example
To calculate the minimum length for shell s:
length = s.Length()
- Shell.Next()¶
Returns the next shell in the model
- Returns:
Shell object (or None if there are no more shells in the model)
- Return type:
Shell
Example
To get the shell in model m after shell s:
s = s.Next()
- Shell.NormalVector()¶
Calculates the unit normal vector for the shell
- Returns:
List of numbers containing x, y and z components of unit normal vector or None if the vector cannot be calculated (for example if the shell has zero area)
- Return type:
int
Example
To calculate the normal vector of shell s:
nvector = s.NormalVector()
- Shell.Previous()¶
Returns the previous shell in the model
- Returns:
Shell object (or None if there are no more shells in the model)
- Return type:
Shell
Example
To get the shell in model m before shell s:
s = s.Previous()
- Shell.RemoveCompositeData(ipt)¶
Removes the composite data for an integration point in *ELEMENT_SHELL_COMPOSITE
- Parameters:
ipt (integer) – The integration point you want to remove. Note that integration points start at 0, not 1
- Returns:
No return value
- Return type:
None
Example
To remove the composite data for the 3rd integration point for shell s:
s.RemoveCompositeData(2)
- Shell.ReverseNormal(redraw=Oasys.gRPC.defaultArg)¶
Reverse shell normal
- Parameters:
redraw (boolean) – Optional. 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
- Return type:
None
Example
To Reverse shell normal for shell s:
s.ReverseNormal()
- Shell.SetCompositeData(ipt, mid, thick, beta, plyid=Oasys.gRPC.defaultArg)¶
Sets the composite data for an integration point in *ELEMENT_SHELL_COMPOSITE
- Parameters:
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 (integer) – Optional. Ply ID for the integration point. This should be used if the _COMPOSITE_LONG option is set for the shell
- Returns:
No return value
- Return type:
None
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)
- Shell.SetFlag(flag)¶
Sets a flag on the shell
- Parameters:
flag (Flag) – Flag to set on the shell
- Returns:
No return value
- Return type:
None
Example
To set flag f for shell s:
s.SetFlag(f)
- Shell.Sketch(redraw=Oasys.gRPC.defaultArg)¶
Sketches the shell. The shell will be sketched until you either call
Shell.Unsketch()
,Shell.UnsketchAll()
,Model.UnsketchAll()
, or delete the model
- Parameters:
redraw (boolean) – Optional. 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
- Return type:
None
Example
To sketch shell s:
s.Sketch()
- Shell.Skew()¶
Calculates the skew for the shell
- Returns:
float
- Return type:
float
Example
To calculate the skew for shell s:
skew = s.Skew()
- Shell.Taper()¶
Calculates the taper for the shell
- Returns:
float
- Return type:
float
Example
To calculate the taper for shell s:
taper = s.Taper()
- Shell.TiedNodeCheck(contact_label, flag, option1, option2)¶
Checks if nodes of shell 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 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:
str
Example
To check if all nodes of shell s are tied by contact 200 or attach directly to constraint:
message = s.TiedNodeCheck(200, flag, 1, 1)
- Shell.Timestep()¶
Calculates the timestep for the shell
- Returns:
float
- Return type:
float
Example
To calculate the timestep for shell s:
timestep = s.Timestep()
- Shell.Unblank()¶
Unblanks the shell
- Returns:
No return value
- Return type:
None
Example
To unblank shell s:
s.Unblank()
- Shell.Unsketch(redraw=Oasys.gRPC.defaultArg)¶
Unsketches the shell
- Parameters:
redraw (boolean) – Optional. 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
- Return type:
None
Example
To unsketch shell s:
s.Unsketch()
- Shell.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:
Shell object
- Return type:
dict
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..
- Shell.Warpage()¶
Calculates the warpage for the shell
- Returns:
float
- Return type:
float
Example
To calculate the warpage for shell s:
warpage = s.Warpage()
- Shell.WeightingFactors(s, t)¶
Calculates the weighting factors for a point on the shell from the isoparametric coords
- Parameters:
s (float) – First isoparametric coordinate
t (float) – Second isoparametric coordinate
- Returns:
List of numbers containing weighting factors or None if not possible to calculate
- Return type:
int
Example
To calculate the weighting factors of isoparametric point (0.5, -0.5) on shell s:
weights = s.WeightingFactors(0.5, -0.5)
- Shell.Xrefs()¶
Returns the cross references for this shell
- Returns:
Xrefs object
- Return type:
dict
Example
To get the cross references for shell s:
xrefs = s.Xrefs()