*setvalue
Updates an existing entity/entities with new/modified data.
Syntax
*setvalue entity_type <select_type>=<selection> <name1>=<value1> ?<name2>=<value2>? ... ?<nameN>=<valueN>? ?row=<row_index>? ?column=<column_index>? ?STATUS=<status>?
Type
HyperMesh Tcl Modify
Description
Updates an existing entity/entities with new/modified data. Data names and attributes are both allowed to be modified, assuming the proper card image is also assigned.
Inputs
- entity_type
- The type of entity to modify.
- <select_type>=<selection>
- The entity or entities that are to be modified. There are several ways to provide the
entities to be modified. Only one option can be used at a time:
- id=<id>
- The ID of the single entity to modify.
- name=<name>
- The name of the single entity to modify.
- mark=<mark_id>
- The ID of the mark containing the entities to modify.
- list=<list_id>
- The ID of the list containing the entities to modify.
- user_ids={<id1> <id2> ... <idN>}
- The IDs of one or more entities to modify.
- user_names={<name1> <name2> ... <nameN>}
- The names of one or more entities to modify.
- <name>=<value>
- The name=value data name and/or attribute pairs that define the relevant data for the entity. For attributes, this can be either the attribute name or ID.
- row=<row_index> (optional)
- Thel row index for a 1D or 2D array. For 1D array, it sets the single value at the specified index. For a 2D array, it must be used together with column_index. This is mandatory for string arrays. For example, to update a string array of size 2:
- column=<column_index> (optional)
- Column index for a 2D array. Used together with row_index, it sets the value at the specified row_index and column_index.
- STATUS=<status>
- This sets an attribute status value. Valid values are 0, 1 or 2. Notice that STATUS must be capitalized.
Examples
Update the node IDs in a set named node_set:
*setvalue sets name=node_set ids={nodes 1 2 3 4 5 6 7 8}
Update the name of entity set with ID 1:
*setvalue sets id=1 name=new_setnodes
Update the attribute Rho of material ID 1 along with Status to value 1:
*setvalue mats id=1 Rho=1.1 STATUS=1
or
*setvalue mats id=1 183=1.1 STATUS=1
Update materialid to 2 for components on mark 1:
*setvalue comps mark=1 materialid=2
Update node1 to 2 for elements 1 and 2 on list 1:
*setvalue elems list=1 node1=2
Update materialid to 2 for components with IDs 1 and 2:
*setvalue comps user_ids={1 2} materialid=2
Update materialid to 2 for components with names "mid" and "center":
*setvalue comps user_names={mid center} materialid=2
Errors
if { [ catch {command_name...} ] } {
# Handle error
}
Version History
13.0