hm_getvalue
Queries data names, attributes, and metadata 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>}? ?metadata_value=<metadata_name>? ?metadata_value_count=<metadata_name>? ?metadata_value_ids=<metadata_name>? ?metadata_value_type=<metadata_name>? ?modelname=<name_of_model>?
Type
HyperMesh Tcl Query Command
Description
Queries data names, attributes, and metadata on entities. It will return the value of any type of data name, attribute, or metadata of an entity. In addition, this command will also return the value at a specific index for array type of data names, attributes, and metadata.
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. If not specified, one of the metadata_value... options must be used.
- 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.
- metadata_value=<metadata_name>
- This is to query the metadata value for a specified metadata name. This is valid for all types of metadata.
- metadata_value_count=<metadata_name>
- This is to query the metadata count for a specified metadata name. This is valid for all types of metadata.
- metadata_value_ids=<metadata_name>
- This is to query the metadata entity IDs for a specified metadata name. This is valid for entity and entity array metadata.
- metadata_value_type=<metadata_name>
- This is to query the metadata entity type for a specified metadata name. This is valid for entity and entity array metadata.
- 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
hm_getvalue sets name=node_set dataname=ids
hm_getvalue sets id=1 dataname=name
hm_getvalue mats id=1 dataname=Rho
hm_getvalue mats id=1 dataname=183
hm_getvalue comps mark=1 dataname=materialid
hm_getvalue elems list=1 dataname=node1
hm_getvalue comps user_names={mid center} dataname=materialid
hm_getvalue includes id=10 dataname=typesundersubmodel
hm_getvalue mats id=1 dataname=Rho modelname=model-2
hm_getvalue loads id=5 dataname=magnitude locationunit={15}
hm_getvalue loads id=5 dataname=magnitude locationunit={25,2}
hm_getvalue comps id=1 metadata_value=mymeta_int
hm_getvalue comps id=1 metadata_value=mymeta_entity
hm_getvalue comps id=1 metadata_value_count=mymeta_entityarray
hm_getvalue comps id=1 metadata_value_ids=mymeta_entityarray
hm_getvalue comps id=1 metadata_value_type=mymeta_entityarray
Errors
if { [ catch {command_name...} ] } {
# Handle error
}
Version History
13.0
2020 - Added new options locationunit and modelname.
2020.1 - Added new options metadata_value, metadata_value_count, metadata_value_ids and metadata_value_type.