Oasys.D3PLOT.Material class

Properties

property Material.include: integer

The include file number in the model that the material is in

property Material.index: integer

The internal index for the material in D3PLOT

property Material.label: integer

The LS-DYNA label for the material

property Material.model: Model

The Model that the material is in

property Material.name: string

The name for the material type (e.g. *MAT_RIGID)

property Material.title: string

The title for the material (or None if no title)

property Material.type: constant

The type for the material (will be Type.MATERIAL)

Static methods

classmethod Material.First(model)

Returns the first material in the model (or None if there are no materials in the model)

Parameters:

model (Model) – Model to get first material in

Returns:

Material object

Return type:

Material

Example

To get the first material in model m:

m = Oasys.D3PLOT.Material.First(m)
classmethod Material.FlagAll(model, flag)

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

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

  • flag (Flag) – Flag (see AllocateFlag) to set on the materials

Returns:

No return value

Return type:

None

Example

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

Oasys.D3PLOT.Material.FlagAll(m, f)
classmethod Material.GetAll(model)

Gets all of the materials in the model

Parameters:

model (Model) – Model that all the materials are in

Returns:

List of Material objects

Return type:

list

Example

To get all of the materials in model m:

m = Oasys.D3PLOT.Material.GetAll(m)
classmethod Material.GetFlagged(model, flag)

Gets all of the materials in the model flagged with a defined flag

Parameters:
  • model (Model) – Model that the flagged materials are in

  • flag (Flag) – Flag (see AllocateFlag) set on the materials to get

Returns:

List of Material objects

Return type:

list

Example

To get all of the materials flagged with flag f in model m:

Oasys.D3PLOT.Material.GetFlagged(m, f)
classmethod Material.GetFromID(model, label)

Returns the Material object for material in model with label (or None if it does not exist)

Parameters:
  • model (Model) – Model to get material in

  • label (integer) – The LS-DYNA label for the material in the model

Returns:

Material object

Return type:

Material

Example

To get the material in model m with label 1000:

m = Oasys.D3PLOT.Material.GetFromID(m, 1000)
classmethod Material.GetFromIndex(model, index)

Returns the Material object for material in model with index (or None if it does not exist)

Parameters:
  • model (Model) – Model to get material in

  • index (integer) – The D3PLOT internal index in the model for material

Returns:

Material object

Return type:

Material

Example

To get the material in model m at index 50:

m = Oasys.D3PLOT.Material.GetFromIndex(m, 50)
classmethod Material.Last(model)

Returns the last material in the model (or None if there are no materials in the model)

Parameters:

model (Model) – Model to get last material in

Returns:

Material object

Return type:

Material

Example

To get the last material in model m:

m = Oasys.D3PLOT.Material.Last(m)
classmethod Material.Total(model)

Returns the total number of materials in the model

Parameters:

model (Model) – Model to get total in

Returns:

The number of materials

Return type:

integer

Example

To get the number of materials in model m:

total = Oasys.D3PLOT.Material.Total(m)
classmethod Material.UnflagAll(model, flag)

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

Parameters:
  • model (Model) – Model that the defined flag for all materials will be unset in

  • flag (Flag) – Flag (see AllocateFlag) to unset on the materials

Returns:

No return value

Return type:

None

Example

To unset flag f on all of the materials in model m:

Oasys.D3PLOT.Material.UnflagAll(m, f)

Instance methods

Material.ClearFlag(flag)

Clears a flag on a material

Parameters:

flag (Flag) – Flag (see AllocateFlag) to clear on the material

Returns:

No return value

Return type:

None

Example

To clear flag f on material m:

m.ClearFlag()
Material.Flagged(flag)

Checks if the material is flagged or not

Parameters:

flag (Flag) – Flag (see AllocateFlag) to test on the material

Returns:

True if flagged, False if not

Return type:

boolean

Example

To check if material m has flag f set on it:

if m.Flagged(f):
    do_something..
Material.Next()

Returns the next material in the model (or None if there is not one)

Returns:

Material object

Return type:

Material

Example

To get the next material after material m:

m = m.Next()
Material.Previous()

Returns the previous material in the model (or None if there is not one)

Returns:

Material object

Return type:

Material

Example

To get the previous material before material m:

m = m.Previous()
Material.SetFlag(flag)

Sets a flag on a material

Parameters:

flag (Flag) – Flag (see AllocateFlag) to set on the material

Returns:

No return value

Return type:

None

Example

To set flag f on material m:

m.SetFlag(f)