Oasys.D3PLOT.Beam class¶
Properties¶
- property Beam.data: float | array¶
Component data for a beam passed as an argument to
GetMultipleData
. Note that data will only exist for the instance of the beam passed toGetMultipleData
. i.e. it is a local property stored on the specific instance. It is not stored in the D3PLOT database
- property Beam.include: integer¶
The include file number in the model that the beam is in
- property Beam.index: integer¶
The internal index for the beam in D3PLOT
- property Beam.integrationPoints: integer¶
The number of integration points that the beam has
- property Beam.label: integer¶
The LS-DYNA label for the beam
- property Beam.material: Material¶
The
Material
the beam has. This is only available if there is a ztf file for the model. If not None will be returned
- property Beam.part: Part¶
The
Part
the beam is in
Static methods¶
- classmethod Beam.BlankAll(window, model)¶
Blanks all of the beams in the model
- Parameters:
window (GraphicsWindow) –
GraphicsWindow
) to blank the beams inmodel (Model) –
Model
that all the beams will be blanked in- Returns:
No return value
- Return type:
None
Example
To blank all of the beams in model m, in graphics window gw:
Oasys.D3PLOT.Beam.BlankAll(gw, m)
- classmethod Beam.BlankFlagged(window, model, flag)¶
Blanks all of the beams in the model flagged with a defined flag
- Parameters:
window (GraphicsWindow) –
GraphicsWindow
) to blank the beams inmodel (Model) –
Model
that the flagged beams will be blanked inflag (Flag) – Flag (see
AllocateFlag
) set on the beams to blank- Returns:
No return value
- Return type:
None
Example
To blank all of the beams flagged with flag f in model m, in graphics window gw:
Oasys.D3PLOT.Beam.BlankFlagged(gw, m, f)
- classmethod Beam.First(model)¶
Returns the first beam in the model (or None if there are no beams in the model)
- Parameters:
model (Model) –
Model
to get first beam in- Returns:
Beam object
- Return type:
Beam
Example
To get the first beam in model m:
b = Oasys.D3PLOT.Beam.First(m)
- classmethod Beam.FlagAll(model, flag)¶
Flags all of the beams in the model with a defined flag
- Parameters:
model (Model) –
Model
that all the beams will be flagged inflag (Flag) – Flag (see
AllocateFlag
) to set on the beams- Returns:
No return value
- Return type:
None
Example
To flag all of the beams with flag f in model m:
Oasys.D3PLOT.Beam.FlagAll(m, f)
- classmethod Beam.GetAll(model)¶
Gets all of the beams in the model
- Parameters:
model (Model) –
Model
that all the beams are in- Returns:
List of
Beam
objects- Return type:
list
Example
To get all of the beams in model m:
b = Oasys.D3PLOT.Beam.GetAll(m)
- classmethod Beam.GetFlagged(model, flag)¶
Gets all of the beams in the model flagged with a defined flag
- Parameters:
model (Model) –
Model
that the flagged beams are inflag (Flag) – Flag (see
AllocateFlag
) set on the beams to get- Returns:
List of
Beam
objects- Return type:
list
Example
To get all of the beams flagged with flag f in model m:
Oasys.D3PLOT.Beam.GetFlagged(m, f)
- classmethod Beam.GetFromID(model, label)¶
Returns the Beam object for beam in model with label (or None if it does not exist)
- Parameters:
model (Model) –
Model
to get beam inlabel (integer) – The LS-DYNA label for the beam in the model
- Returns:
Beam object
- Return type:
Beam
Example
To get the beam in model m with label 1000:
b = Oasys.D3PLOT.Beam.GetFromID(m, 1000)
- classmethod Beam.GetFromIndex(model, index)¶
Returns the Beam object for beam in model with index (or None if it does not exist)
- Parameters:
model (Model) –
Model
to get beam inindex (integer) – The D3PLOT internal index in the model for beam
- Returns:
Beam object
- Return type:
Beam
Example
To get the beam in model m at index 50:
b = Oasys.D3PLOT.Beam.GetFromIndex(m, 50)
- classmethod Beam.GetMultipleData(component, items, options=Oasys.gRPC.defaultArg)¶
Returns the value for a data component for multiple beams. For each beam 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
Beam
objects to get the data for. All of the beams 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 beam 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 beams in list items and use the data property (note that in the example, the argument extra is optional):
Oasys.D3PLOT.Beam.GetMultipleData(component, items, {"extra": 1}) for item in items: if item.data != None: do_something..To calculate a component for beams in list items and use the return value (note that in the example, the argument extra is optional):
data = Oasys.D3PLOT.Beam.GetMultipleData(component, items, {"extra": 1}) for d in data: Oasys.D3PLOT.Message("Label is {}".format(d)) if data[d] != None: do_something..
- classmethod Beam.Last(model)¶
Returns the last beam in the model (or None if there are no beams in the model)
- Parameters:
model (Model) –
Model
to get last beam in- Returns:
Beam object
- Return type:
Beam
Example
To get the last beam in model m:
b = Oasys.D3PLOT.Beam.Last(m)
- classmethod Beam.Pick()¶
Allows the user to pick a beam from the screen
- Returns:
Beam object or None if cancelled
- Return type:
Beam
Example
To pick a beam:
b = Oasys.D3PLOT.Beam.Pick()
- classmethod Beam.Select(flag)¶
Selects beams using an object menu
- Parameters:
flag (Flag) – Flag (see
AllocateFlag
) to use when selecting beams- Returns:
The number of beams selected or None if menu cancelled
- Return type:
integer
Example
To select beams, flagging those selected with flag f:
total = Oasys.D3PLOT.Beam.Select(f)
- classmethod Beam.Total(model)¶
Returns the total number of beams in the model
- Parameters:
model (Model) –
Model
to get total in- Returns:
The number of beams
- Return type:
integer
Example
To get the number of beams in model m:
total = Oasys.D3PLOT.Beam.Total(m)
- classmethod Beam.TotalDeleted(model)¶
Returns the total number of beams that have been deleted in a model
- Parameters:
model (Model) –
Model
to get total in- Returns:
The number of beams that have been deleted
- Return type:
integer
Example
To get the number of beams in model m that have been deleted:
total = Oasys.D3PLOT.Beam.TotalDeleted(m)
- classmethod Beam.UnblankAll(window, model)¶
Unblanks all of the beams in the model
- Parameters:
window (GraphicsWindow) –
GraphicsWindow
) to unblank the beams inmodel (Model) –
Model
that all the beams will be unblanked in- Returns:
No return value
- Return type:
None
Example
To unblank all of the beams in model m, in graphics window gw:
Oasys.D3PLOT.Beam.UnblankAll(gw, m)
- classmethod Beam.UnblankFlagged(window, model, flag)¶
Unblanks all of the beams in the model flagged with a defined flag
- Parameters:
window (GraphicsWindow) –
GraphicsWindow
) to unblank the beams inmodel (Model) –
Model
that the flagged beams will be unblanked inflag (Flag) – Flag (see
AllocateFlag
) set on the beams to unblank- Returns:
No return value
- Return type:
None
Example
To unblank all of the beams flagged with flag f in model m, in graphics window gw:
Oasys.D3PLOT.Beam.UnblankFlagged(gw, m, f)
- classmethod Beam.UnflagAll(model, flag)¶
Unsets a defined flag on all of the beams in the model
- Parameters:
model (Model) –
Model
that the defined flag for all beams will be unset inflag (Flag) – Flag (see
AllocateFlag
) to unset on the beams- Returns:
No return value
- Return type:
None
Example
To unset flag f on all of the beams in model m:
Oasys.D3PLOT.Beam.UnflagAll(m, f)
Instance methods¶
- Beam.Blank(window)¶
Blanks the beam in a graphics window
- Parameters:
window (GraphicsWindow) –
GraphicsWindow
) to blank the beam in- Returns:
No return value
- Return type:
None
Example
To blank beam b in graphics window g:
b.Blank(g)
- Beam.Blanked(window)¶
Checks if the beam is blanked in a graphics window or not
- Parameters:
window (GraphicsWindow) –
GraphicsWindow
) in which to check if the beam is blanked- Returns:
True if blanked, False if not
- Return type:
boolean
Example
To check if beam b is blanked in graphics window g:
if b.Blanked(g): do_something..
- Beam.ClearFlag(flag)¶
Clears a flag on a beam
- Parameters:
flag (Flag) – Flag (see
AllocateFlag
) to clear on the beam- Returns:
No return value
- Return type:
None
Example
To clear flag f on beam b:
b.ClearFlag()
- Beam.Deleted()¶
Checks if the beam has been deleted or not
- Returns:
True if deleted, False if not
- Return type:
boolean
Example
To check if beam b has been deleted:
if b.Deleted(): do_something..
- Beam.Flagged(flag)¶
Checks if the beam is flagged or not
- Parameters:
flag (Flag) – Flag (see
AllocateFlag
) to test on the beam- Returns:
True if flagged, False if not
- Return type:
boolean
Example
To check if beam b has flag f set on it:
if b.Flagged(f): do_something..
- Beam.ForceMoment(options=Oasys.gRPC.defaultArg)¶
Returns the forces and moments for the beam
- 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:
Array containing the forces and moments [Fx, Fy, Fz, Mxx, Myy, Mzz] (or None if the value cannot be calculated)
- Return type:
array
Example
To return the forces and moments of beam b:
fm = b.ForceMoment() if fm != None: do_something..
- Beam.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 = b.GetData(component, {"extra": 1}) if value != None: do_something..
- Beam.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 beam b:
axes = b.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] ]
- Beam.Next()¶
Returns the next beam in the model (or None if there is not one)
- Returns:
Beam object
- Return type:
Beam
Example
To get the next beam after beam b:
b = b.Next()
- Beam.Previous()¶
Returns the previous beam in the model (or None if there is not one)
- Returns:
Beam object
- Return type:
Beam
Example
To get the previous beam before beam b:
b = b.Previous()
- Beam.SetFlag(flag)¶
Sets a flag on a beam
- Parameters:
flag (Flag) – Flag (see
AllocateFlag
) to set on the beam- Returns:
No return value
- Return type:
None
Example
To set flag f on beam b:
b.SetFlag(f)
- Beam.Topology()¶
Returns the topology for the beam in the model
- Returns:
list of Node objects
- Return type:
list
Example
To get the topology for beam b:
topology = b.Topology()
- Beam.Unblank(window)¶
Unblanks the beam in a graphics window
- Parameters:
window (GraphicsWindow) –
GraphicsWindow
) to unblank the beam in- Returns:
No return value
- Return type:
None
Example
To unblank beam b in graphics window g:
b.Unblank(g)