hm_getvalue

Queries data names and attributes on entities.

Syntax

hm_getvalue entity_type <select_type>=<selection> dataname=<data name or attribute name/ID> ?row=<row_index>? ?column=<column_index>?

Type

HyperMesh Tcl Query

Description

Queries data names and attributes on entities. It will return the value of any type of data name or attribute of an entity. In addition, this command will also return the value at a specific index for array type of data names and attributes.

Inputs

entity_type
The type of entity to query.
<select_type>=<selection>
The entity or entities that are to be queried. There are several ways to provide the entities to be queried. Only one option can be used at a time:
id=<id>
The ID of the single entity to query.
name=<name>
The name of the single entity to query.
mark=<mark_id>
The ID of the mark containing the entities to query.
list=<list_id>
The ID of the list containing the entities to query.
user_ids={<id1> <id2> ... <idN>}
The IDs of one or more entities to query.
user_names={<name1> <name2> ... <nameN>}
The names of one or more entities to query.
dataname=<data name or attribute name/ID>
The dataname=value data name and/or attribute pair that defines the relevant data to query. For attributes, this can be either the attribute name or ID.
row=<row_index>
This is the optional row index for a 1D or 2D array. For 1D array, it returns the single value at the specified index. For a 2D array, it will return the entire row.
column=<column_index>
This is the optional column index for a 2D array. Used together with row_index, it returns the value at the specified row_index and column_index.

Examples

Get the node IDs in a set named node_set:

hm_getvalue sets name=node_set dataname=ids

Get the name of entity set with ID 1:

hm_getvalue sets id=1 dataname=name

Get the attribute Rho of material ID 1:

hm_getvalue mats id=1 dataname=Rho

oGet node1 for elements 1 and 2 on list 1:r

hm_getvalue mats id=1 dataname=183

Get materialid for components on mark 1:

hm_getvalue comps mark=1 dataname=materialid

Get node1 for elements 1 and 2 on list 1:

hm_getvalue elems list=1 dataname=node1

Get materialid for components with names "mid" and "center":

hm_getvalue comps user_names={mid center} dataname=materialid

Get submodel types for include file 10:

hm_getvalue includes id=10 dataname=typesundersubmodel

Errors

Incorrect usage results in a Tcl error. To detect errors, you can use the catch command:
if { [ catch {command_name...} ] } {
   # Handle error
}

Version History

13.0