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>? ?locationunit={<entity_id> <face_index>}? ?modelname=<name_of_model>?

Type

HyperMesh Tcl Query Command

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.
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.
locationunit={<entity_id>, <face_index>}
Valid only for engineering loads. This is required if a non-uniform load is being queried. If the load is applied on a regular set, only <entity_id> is needed. If the load is applied on solid element faces, then <face_index> is also required.
entity_id
The ID of the entity to query.
face_index
The index of the solid element face.
modelname=<name_of_model>
This is the optional model name to query when there are multiple models in the database. If not specified, the current model is used.
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.

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
Get the attribute 183 of material ID 1:
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
Get the attribute Rho of material ID 1 for model model-2:
hm_getvalue mats id=1 dataname=Rho modelname=model-2
Get a magnitude value for non-uniform distributed load 5 on node 15:
hm_getvalue loads id=5 dataname=magnitude locationunit={15}
Get a magnitude value for non-uniform distributed load 5 on element 25 face 2:
hm_getvalue loads id=5 dataname=magnitude locationunit={25,2}

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

2020 - Added new options locationunit and modelname.