hm_elemlist
Get a list of element IDs or types for the passed component.
Syntax
hm_elemlist listType compName
Type
HyperMesh Tcl Query
Description
Get a list of element IDs or types for the passed component.
Inputs
- listType
- Type of list to generate (ID or type).
- compName
- The name of the component containing the elements.
Example
To generate a list of elements IDs of type elemType for a named component.
set elemIds [ hm_elemlist id $compName ];
set elemTypes [ hm_elemlist type $compName ];
set numIds [ llength $elemIds ];
set elemList {};
for { set i 0 } { $i < $numIds } { incr i } {
set curType [ lindex $elemTypes $i ];
if { $curType == $elemType } {
lappend elemList [ lindex $elemIds $i ];
}
}
return $elemList;
This command returns an empty list, if the component is empty or if the component does not exist.
Errors
None.