Oasys.D3PLOT.SetPart class

Properties

property SetPart.include(read only): integer

The include file number in the model that the part set is in

property SetPart.index(read only): integer

The internal index for the part set in D3PLOT (starting at 0)

property SetPart.label(read only): integer

The Ansys LS-DYNA label for the part set

property SetPart.model(read only): Model

The Model that the part set is in

property SetPart.title(read only): string

The title for the part set (or None if no title). This is only available if there is a ztf file for the model. If not None will be returned

property SetPart.total(read only): integer

The total number of part items in the part set

property SetPart.type(read only): constant

The type for the part set (will be Type.SET_PART)

Static methods

classmethod SetPart.First(model)

Returns the first part set in the model (or None if there are no part sets in the model)

Parameters:

model (Model) – Model to get first part set in

Returns:

SetPart object

Return type:

SetPart

Example

To get the first part set in model m:

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

Flags all of the part sets in the model with a defined flag

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

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

Returns:

No return value

Return type:

None

Example

To flag all of the part sets with flag f in model m:

Oasys.D3PLOT.SetPart.FlagAll(m, f)
classmethod SetPart.GetAll(model, property=Oasys.gRPC.defaultArg)

Returns a list of SetPart objects or properties for all of the part sets in the model. If the optional property argument is not given then a list of SetPart objects is returned. If the property argument is given, that property value for each part set is returned in the list instead of a SetPart object

Parameters:
  • model (Model) – Model that all the part sets are in

  • property (string) – Optional. Name for property to get for all part sets in the model

Returns:

List of SetPart objects or properties

Return type:

list

Example

To get all of the part sets in model m:

s = Oasys.D3PLOT.SetPart.GetAll(m)

To return a list containing the value of property ‘foo’ (for example ‘label’ for a part set) for each part set in model m:

a = Oasys.D3PLOT.SetPart.GetAll(m, 'foo');
classmethod SetPart.GetFlagged(model, flag, property=Oasys.gRPC.defaultArg)

Gets all of the part sets in the model flagged with a defined flag. If the optional property argument is not given then a list of SetPart objects is returned. If the property argument is given, that property value for each part set is returned in the list instead of a SetPart object

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

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

  • property (string) – Optional. Name for property to get for all flagged part sets in the model

Returns:

List of SetPart objects or properties

Return type:

list

Example

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

Oasys.D3PLOT.SetPart.GetFlagged(m, f)

To return a list containing the value of property ‘foo’ (for example ‘label’ for a node) for all part sets flagged with flag f in model m:

a = Oasys.D3PLOT.SetPart.GetFlagged(m, f, 'foo');
classmethod SetPart.GetFromID(model, label)

Returns the SetPart object for part set in model with label (or None if it does not exist)

Parameters:
  • model (Model) – Model to get part set in

  • label (integer) – The Ansys LS-DYNA label for the part set in the model

Returns:

SetPart object

Return type:

SetPart

Example

To get the part set in model m with label 1000:

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

Returns the SetPart object for part set in model with index (or None if it does not exist)

Parameters:
  • model (Model) – Model to get part set in

  • index (integer) – The D3PLOT internal index in the model for part set, starting at 0

Returns:

SetPart object

Return type:

SetPart

Example

To get the 51st part set in model m:

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

Returns the last part set in the model (or None if there are no part sets in the model)

Parameters:

model (Model) – Model to get last part set in

Returns:

SetPart object

Return type:

SetPart

Example

To get the last part set in model m:

s = Oasys.D3PLOT.SetPart.Last(m)
classmethod SetPart.Total(model)

Returns the total number of part sets in the model

Parameters:

model (Model) – Model to get total in

Returns:

The number of part sets

Return type:

integer

Example

To get the number of part sets in model m:

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

Unsets a defined flag on all of the part sets in the model

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

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

Returns:

No return value

Return type:

None

Example

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

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

Instance methods

SetPart.AllItems()

Returns all of the part items for the part set in the model

Returns:

list of Part objects

Return type:

list

Example

To get the part items in part set s:

items = s.AllItems()
SetPart.ClearFlag(flag)

Clears a flag on a part set

Parameters:

flag (Flag) – Flag (see AllocateFlag) to clear on the part set

Returns:

No return value

Return type:

None

Example

To clear flag f on part set s:

s.ClearFlag()
SetPart.Flagged(flag)

Checks if the part set is flagged or not

Parameters:

flag (Flag) – Flag (see AllocateFlag) to test on the part set

Returns:

True if flagged, False if not

Return type:

boolean

Example

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

if s.Flagged(f):
    do_something..
SetPart.Item(index)

Returns a part item from the part set in the model

Parameters:

index (integer) – The index in the part set to get the part from (0 <= index < total)

Returns:

Part object

Return type:

Part

Example

To get the 10th part in part set s:

items = s.Item(9)
SetPart.Next()

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

Returns:

SetPart object

Return type:

SetPart

Example

To get the next part set after part set s:

s = s.Next()
SetPart.Previous()

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

Returns:

SetPart object

Return type:

SetPart

Example

To get the previous part set before part set s:

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

Sets a flag on a part set

Parameters:

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

Returns:

No return value

Return type:

None

Example

To set flag f on part set s:

s.SetFlag(f)