*sortelements()

Sets the order that elements are output in an *elements() block.

Syntax

*sortelements (order)

Type

HyperMesh Template Command

Description

Sets the order that elements are output in an *elements() block.

This command must be inside a standalone *elements() block (that is a block not inside another block like *components()) and should be called in the *before() section.

Inputs

order
Valid values are:
bycomponentid - Ordering is performed based on component ID.
byid - Ordering is performed by ID.
bymaterialid - Ordering is performed based on material ID.
bypropertyid - Ordering is performed based on property ID.
none - No ordering is performed.

Example

To output elements in order based on material ID:

*elements(0,0,"","")
  *before()
    *variableset(variable1,0)
    *sortelements(bymaterialid)
  *format()
    *if([variable1 != collector.materialid])
      *string("Elements in material")
      *field(integer,collector.materialid,0)
      *end()
      *variableset(variable1,collector.materialid)
    *endif()
    *string("id = ")
    *field(integer,id,0)
    *end()
*output()

To output elements in order based on ID:

*elements(0,0,"","")
  *before()
    *sortelements(byid)
  *format()
    *string("id = ")
    *field(integer,id,0)
    *end()
*output()