Oasys.D3PLOT.SetNode class

Properties

property SetNode.include(read only): integer

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

property SetNode.index(read only): integer

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

property SetNode.label(read only): integer

The Ansys LS-DYNA label for the node set

property SetNode.model(read only): Model

The Model that the node set is in

property SetNode.title(read only): string

The title for the node 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 SetNode.total(read only): integer

The total number of node items in the node set

property SetNode.type(read only): constant

The type for the node set (will be Type.SET_NODE)

Static methods

classmethod SetNode.First(model)

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

Parameters:

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

Returns:

SetNode object

Return type:

SetNode

Example

To get the first node set in model m:

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

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

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

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

Returns:

No return value

Return type:

None

Example

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

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

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

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

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

Returns:

List of SetNode objects or properties

Return type:

list

Example

To get all of the node sets in model m:

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

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

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

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

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

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

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

Returns:

List of SetNode objects or properties

Return type:

list

Example

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

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

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

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

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

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

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

Returns:

SetNode object

Return type:

SetNode

Example

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

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

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

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

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

Returns:

SetNode object

Return type:

SetNode

Example

To get the 51st node set in model m:

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

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

Parameters:

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

Returns:

SetNode object

Return type:

SetNode

Example

To get the last node set in model m:

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

Returns the total number of node sets in the model

Parameters:

model (Model) – Model to get total in

Returns:

The number of node sets

Return type:

integer

Example

To get the number of node sets in model m:

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

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

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

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

Returns:

No return value

Return type:

None

Example

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

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

Instance methods

SetNode.AllItems()

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

Returns:

list of Node objects

Return type:

list

Example

To get the node items in node set s:

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

Clears a flag on a node set

Parameters:

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

Returns:

No return value

Return type:

None

Example

To clear flag f on node set s:

s.ClearFlag()
SetNode.Flagged(flag)

Checks if the node set is flagged or not

Parameters:

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

Returns:

True if flagged, False if not

Return type:

boolean

Example

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

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

Returns a node item from the node set in the model

Parameters:

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

Returns:

Node object

Return type:

Node

Example

To get the 10th node in node set s:

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

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

Returns:

SetNode object

Return type:

SetNode

Example

To get the next node set after node set s:

s = s.Next()
SetNode.Previous()

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

Returns:

SetNode object

Return type:

SetNode

Example

To get the previous node set before node set s:

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

Sets a flag on a node set

Parameters:

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

Returns:

No return value

Return type:

None

Example

To set flag f on node set s:

s.SetFlag(f)