Oasys.D3PLOT.Solid class¶
Properties¶
- property Solid.data: float | array¶
Component data for a solid passed as an argument to
GetMultipleData
. Note that data will only exist for the instance of the solid passed toGetMultipleData
. i.e. it is a local property stored on the specific instance. It is not stored in the D3PLOT database
- property Solid.include: integer¶
The include file number in the model that the solid is in
- property Solid.index: integer¶
The internal index for the solid in D3PLOT
- property Solid.label: integer¶
The LS-DYNA label for the solid
- property Solid.material: Material¶
The
Material
the solid has. This is only available if there is a ztf file for the model. If not None will be returned
- property Solid.part: Part¶
The
Part
the solid is in
- property Solid.type: constant¶
The type for the solid (will be
Type.SOLID
)
Static methods¶
- classmethod Solid.BlankAll(window, model)¶
Blanks all of the solids in the model
- Parameters:
window (GraphicsWindow) –
GraphicsWindow
) to blank the solids inmodel (Model) –
Model
that all the solids will be blanked in- Returns:
No return value
- Return type:
None
Example
To blank all of the solids in model m, in graphics window gw:
Oasys.D3PLOT.Solid.BlankAll(gw, m)
- classmethod Solid.BlankFlagged(window, model, flag)¶
Blanks all of the solids in the model flagged with a defined flag
- Parameters:
window (GraphicsWindow) –
GraphicsWindow
) to blank the solids inmodel (Model) –
Model
that the flagged solids will be blanked inflag (Flag) – Flag (see
AllocateFlag
) set on the solids to blank- Returns:
No return value
- Return type:
None
Example
To blank all of the solids flagged with flag f in model m, in graphics window gw:
Oasys.D3PLOT.Solid.BlankFlagged(gw, m, f)
- classmethod Solid.First(model)¶
Returns the first solid in the model (or None if there are no solids in the model)
- Parameters:
model (Model) –
Model
to get first solid in- Returns:
Solid object
- Return type:
Solid
Example
To get the first solid in model m:
s = Oasys.D3PLOT.Solid.First(m)
- classmethod Solid.FlagAll(model, flag)¶
Flags all of the solids in the model with a defined flag
- Parameters:
model (Model) –
Model
that all the solids will be flagged inflag (Flag) – Flag (see
AllocateFlag
) 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.D3PLOT.Solid.FlagAll(m, f)
- classmethod Solid.GetAll(model)¶
Gets all of the solids in the model
- Parameters:
model (Model) –
Model
that all the solids are in- Returns:
List of
Solid
objects- Return type:
list
Example
To get all of the solids in model m:
s = Oasys.D3PLOT.Solid.GetAll(m)
- classmethod Solid.GetFlagged(model, flag)¶
Gets all of the solids in the model flagged with a defined flag
- Parameters:
model (Model) –
Model
that the flagged solids are inflag (Flag) – Flag (see
AllocateFlag
) set on the solids to get- Returns:
List of
Solid
objects- Return type:
list
Example
To get all of the solids flagged with flag f in model m:
Oasys.D3PLOT.Solid.GetFlagged(m, f)
- classmethod Solid.GetFromID(model, label)¶
Returns the Solid object for solid in model with label (or None if it does not exist)
- Parameters:
model (Model) –
Model
to get solid inlabel (integer) – The LS-DYNA label for the solid in the model
- Returns:
Solid object
- Return type:
Solid
Example
To get the solid in model m with label 1000:
s = Oasys.D3PLOT.Solid.GetFromID(m, 1000)
- classmethod Solid.GetFromIndex(model, index)¶
Returns the Solid object for solid in model with index (or None if it does not exist)
- Parameters:
model (Model) –
Model
to get solid inindex (integer) – The D3PLOT internal index in the model for solid
- Returns:
Solid object
- Return type:
Solid
Example
To get the solid in model m at index 50:
s = Oasys.D3PLOT.Solid.GetFromIndex(m, 50)
- classmethod Solid.GetMultipleData(component, items, options=Oasys.gRPC.defaultArg)¶
Returns the value for a data component for multiple solids. For each solid a local property called data will be created containing a number if a scalar component, or a list if a vector or tensor component (or None if the value cannot be calculated). The data is also returned as an object.
Also seeGetData
- Parameters:
component (constant) – Component constant to get data for
items (list) – List of
Solid
objects to get the data for. All of the solids must be in the same modeloptions (dict) –
Optional. Dictionary containing options for getting data. Can be any of:
- extra:
(integer) The extra data component number if component
Component.SOX
for solids,Component.BMX
for beams orComponent.SHX
for shells and thick shells- ip:
(integer) Integration point number to get the data at (ip >= 1 or one of the constants
Constant.TOP
,Constant.MIDDLE
orConstant.BOTTOM
)- op:
(integer) On plane integration point number for shells and thick shells (op >= 1 [default])
- referenceFrame:
(constant) The frame of reference to return values in. Either
Constant.GLOBAL
(default),Constant.LOCAL
,Constant.CYLINDRICAL
,Constant.USER_DEFINED
orConstant.MATERIAL
. This is only necessary for directional components (eg X stress) and then only when something other than the defaultConstant.GLOBAL
coordinate system is to be used- user:
(integer) The user-defined component number if component
Component.UNOS
,Component.UNOV
,Component.USSS
,Component.USST
,Component.UBMS
orComponent.UBMV
- Returns:
Dictionary containing the data. A property is created in the dictionary for each solid with the label. The value of the property is a number if a scalar component or an array if a vector or tensor component (or None if the value cannot be calculated)
- Return type:
dictionary
Example
To calculate a component for solids in list items and use the data property (note that in the example, the argument extra is optional):
Oasys.D3PLOT.Solid.GetMultipleData(component, items, {"extra": 1}) for item in items: if item.data != None: do_something..To calculate a component for solids in list items and use the return value (note that in the example, the argument extra is optional):
data = Oasys.D3PLOT.Solid.GetMultipleData(component, items, {"extra": 1}) for d in data: Oasys.D3PLOT.Message("Label is {}".format(d)) if data[d] != None: do_something..
- classmethod Solid.Last(model)¶
Returns the last solid in the model (or None if there are no solids in the model)
- Parameters:
model (Model) –
Model
to get last solid in- Returns:
Solid object
- Return type:
Solid
Example
To get the last solid in model m:
s = Oasys.D3PLOT.Solid.Last(m)
- classmethod Solid.Pick()¶
Allows the user to pick a solid from the screen
- Returns:
Solid object or None if cancelled
- Return type:
Solid
Example
To pick a solid:
s = Oasys.D3PLOT.Solid.Pick()
- classmethod Solid.Select(flag)¶
Selects solids using an object menu
- Parameters:
flag (Flag) – Flag (see
AllocateFlag
) to use when selecting solids- Returns:
The number of solids selected or None if menu cancelled
- Return type:
integer
Example
To select solids, flagging those selected with flag f:
total = Oasys.D3PLOT.Solid.Select(f)
- classmethod Solid.Total(model)¶
Returns the total number of solids in the model
- Parameters:
model (Model) –
Model
to get total in- Returns:
The number of solids
- Return type:
integer
Example
To get the number of solids in model m:
total = Oasys.D3PLOT.Solid.Total(m)
- classmethod Solid.TotalDeleted(model)¶
Returns the total number of solids that have been deleted in a model
- Parameters:
model (Model) –
Model
to get total in- Returns:
The number of solids that have been deleted
- Return type:
integer
Example
To get the number of solids in model m that have been deleted:
total = Oasys.D3PLOT.Solid.TotalDeleted(m)
- classmethod Solid.UnblankAll(window, model)¶
Unblanks all of the solids in the model
- Parameters:
window (GraphicsWindow) –
GraphicsWindow
) to unblank the solids inmodel (Model) –
Model
that all the solids will be unblanked in- Returns:
No return value
- Return type:
None
Example
To unblank all of the solids in model m, in graphics window gw:
Oasys.D3PLOT.Solid.UnblankAll(gw, m)
- classmethod Solid.UnblankFlagged(window, model, flag)¶
Unblanks all of the solids in the model flagged with a defined flag
- Parameters:
window (GraphicsWindow) –
GraphicsWindow
) to unblank the solids inmodel (Model) –
Model
that the flagged solids will be unblanked inflag (Flag) – Flag (see
AllocateFlag
) set on the solids to unblank- Returns:
No return value
- Return type:
None
Example
To unblank all of the solids flagged with flag f in model m, in graphics window gw:
Oasys.D3PLOT.Solid.UnblankFlagged(gw, 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 inflag (Flag) – Flag (see
AllocateFlag
) to unset on the solids- Returns:
No return value
- Return type:
None
Example
To unset flag f on all of the solids in model m:
Oasys.D3PLOT.Solid.UnflagAll(m, f)
Instance methods¶
- Solid.Blank(window)¶
Blanks the solid in a graphics window
- Parameters:
window (GraphicsWindow) –
GraphicsWindow
) to blank the solid in- Returns:
No return value
- Return type:
None
Example
To blank solid s in graphics window g:
s.Blank(g)
- Solid.Blanked(window)¶
Checks if the solid is blanked in a graphics window or not
- Parameters:
window (GraphicsWindow) –
GraphicsWindow
) in which to check if the solid is blanked- Returns:
True if blanked, False if not
- Return type:
boolean
Example
To check if solid s is blanked in graphics window g:
if s.Blanked(g): do_something..
- Solid.ClearFlag(flag)¶
Clears a flag on a solid
- Parameters:
flag (Flag) – Flag (see
AllocateFlag
) to clear on the solid- Returns:
No return value
- Return type:
None
Example
To clear flag f on solid s:
s.ClearFlag()
- Solid.Deleted()¶
Checks if the solid has been deleted or not
- Returns:
True if deleted, False if not
- Return type:
boolean
Example
To check if solid s has been deleted:
if s.Deleted(): do_something..
- Solid.Flagged(flag)¶
Checks if the solid is flagged or not
- Parameters:
flag (Flag) – Flag (see
AllocateFlag
) 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..
- Solid.GetData(component, options=Oasys.gRPC.defaultArg)¶
Returns the value for a data component.
Also seeGetMultipleData
- Parameters:
component (constant) – Component constant to get data for
options (dict) –
Optional. Dictionary containing options for getting data. Can be any of:
- extra:
(integer) The extra data component number if component
Component.SOX
for solids,Component.BMX
for beams orComponent.SHX
for shells and thick shells- ip:
(integer) Integration point number to get the data at (ip >= 1 or one of the constants
Constant.TOP
,Constant.MIDDLE
orConstant.BOTTOM
). If the integration point is not defined it will use the integration point defined on the current GUI “data” panel, which defaults to the middle surface for shells, thick shells, and solids, and Mag All for beams, but may vary if changed by an interactive user. If consistent output from a script is required, independent of any prior interactive activity, an explicit integration point or surface should be defined- op:
(integer) On plane integration point number for shells and thick shells (op >= 1 [default])
- referenceFrame:
(constant) The frame of reference to return values in. Either
Constant.GLOBAL
(default),Constant.LOCAL
,Constant.CYLINDRICAL
,Constant.USER_DEFINED
orConstant.MATERIAL
. This is only necessary for directional components (eg X stress) and then only when something other than the defaultConstant.GLOBAL
coordinate system is to be used- user:
(integer) The user-defined component number if component
Component.UNOS
,Component.UNOV
,Component.USSS
,Component.USST
,Component.UBMS
orComponent.UBMV
- Returns:
Number if a scalar component, array if a vector or tensor component (or None if the value cannot be calculated because it’s not available in the model).<br> If requesting an invalid component it will throw an error (e.g. Component.AREA of a node).
- Return type:
float|array
Example
To calculate a component and check it has been calculated (note that in the example, the argument extra is optional):
value = s.GetData(component, {"extra": 1}) if value != None: do_something..
- Solid.LocalAxes()¶
Returns the local axes of the element in model space, expressed as direction cosines in a 2D list. Beam elements must have 3 nodes to be able to return local axes
- Returns:
list of lists
- Return type:
list
Example
To get the local axes for solid s:
axes = s.LocalAxes() xAxis = [ axes[0][0], axes[0][1], axes[0][2] ] yAxis = [ axes[1][0], axes[1][1], axes[1][2] ] zAxis = [ axes[2][0], axes[2][1], axes[2][2] ]
- Solid.Next()¶
Returns the next solid in the model (or None if there is not one)
- Returns:
Solid object
- Return type:
Solid
Example
To get the next solid after solid s:
s = s.Next()
- Solid.PlasticStrain(options=Oasys.gRPC.defaultArg)¶
Returns the effective plastic strain for the solid (or None if the value cannot be calculated)
- Parameters:
options (dict) –
Optional. Dictionary containing options for getting data. Can be any of:
- ip:
(integer) Integration point number to get the data at (ip >= 1)
- Returns:
Plastic strain
- Return type:
float
Example
To return the effective plastic strain of solid s:
strain = s.PlasticStrain() if strain != None: do_something..
- Solid.Previous()¶
Returns the previous solid in the model (or None if there is not one)
- Returns:
Solid object
- Return type:
Solid
Example
To get the previous solid before solid s:
s = s.Previous()
- Solid.SetFlag(flag)¶
Sets a flag on a solid
- Parameters:
flag (Flag) – Flag (see
AllocateFlag
) to set on the solid- Returns:
No return value
- Return type:
None
Example
To set flag f on solid s:
s.SetFlag(f)
- Solid.StrainTensor(options=Oasys.gRPC.defaultArg)¶
Returns the strain tensor for the solid
- Parameters:
options (dict) –
Optional. Dictionary containing options for getting data. Can be any of:
- ip:
(integer) Integration point number to get the data at (ip >= 1)
- referenceFrame:
(constant) The frame of reference to return values in. Either
Constant.GLOBAL
(default),Constant.LOCAL
,Constant.CYLINDRICAL
,Constant.USER_DEFINED
orConstant.MATERIAL
- Returns:
Array containing the strain tensor [Exx, Eyy, Ezz, Exy, Eyz, Ezx] (or None if the value cannot be calculated)
- Return type:
array
Example
To return the strain tensor of solid s:
tensor = s.StrainTensor() if tensor != None: do_something..
- Solid.StressTensor(options=Oasys.gRPC.defaultArg)¶
Returns the stress tensor for the solid
- Parameters:
options (dict) –
Optional. Dictionary containing options for getting data. Can be any of:
- ip:
(integer) Integration point number to get the data at (ip >= 1)
- referenceFrame:
(constant) The frame of reference to return values in. Either
Constant.GLOBAL
(default),Constant.LOCAL
,Constant.CYLINDRICAL
,Constant.USER_DEFINED
orConstant.MATERIAL
- Returns:
Array containing the stress tensor [Exx, Eyy, Ezz, Exy, Eyz, Ezx] (or None if the value cannot be calculated)
- Return type:
array
Example
To return the stress tensor of solid s:
tensor = s.StressTensor() if tensor != None: do_something..
- Solid.Topology()¶
Returns the topology for the solid in the model
- Returns:
list of Node objects
- Return type:
list
Example
To get the topology for solid s:
topology = s.Topology()
- Solid.Unblank(window)¶
Unblanks the solid in a graphics window
- Parameters:
window (GraphicsWindow) –
GraphicsWindow
) to unblank the solid in- Returns:
No return value
- Return type:
None
Example
To unblank solid s in graphics window g:
s.Unblank(g)
- Solid.VonMisesStress(options=Oasys.gRPC.defaultArg)¶
Returns the von Mises stress for the solid (or None if the value cannot be calculated)
- Parameters:
options (dict) –
Optional. Dictionary containing options for getting data. Can be any of:
- ip:
(integer) Integration point number to get the data at (ip >= 1)
- Returns:
von Mises stress
- Return type:
float
Example
To return the von Mises stress of solid s:
svm = s.VonMisesStress() if svm != None: do_something..