hm_marktotable
Creates a named mark table and populates it with the entities on a mark.
Syntax
hm_marktotable entity_type mark_id table_name ?panel_sensitive? ?force?
Type
HyperMesh Tcl Query
Description
Creates a named mark table and populates it with the entities on a mark.
Tables are not stored within a HyperMesh file. When the current model is deleted or a new model is loaded, all tables are cleared. If a table contains an entity that is subsequently deleted, the entity is removed from the table.
Inputs
- entity_type
- The type of entity mark to create the table for.
- mark_id
- The ID of the mark containing the entities. Valid values are 1 and 2.
- table_name
- The name of the table to create. If a table with this name already exists, it will be replaced with the new table.
- panel_sensitive
- Can be used when multiple panel levels have been pushed, either using the shortcut function keys, or the hm_pushpanel command. This option determines whether to use the current panel or the previous panel for the operation. This option is relevant only when the list has been created from a panel entity selector under the above conditions. Valid options are:
- force
- 0 – Do not create the table if the mark is empty (default).
Example
To find all displayed elements that contain free edges and split them:
*createmark comps 1 "displayed"
*findedges comps 1 0
*createmarklast elems 1
hm_marktotable elems 1 plot_table
*findmark elems 1 1 0 nodes 0 1
*findmark nodes 1 1 0 elems 0 1
foreach elem_id [hm_getmark elems $elem_mark] {
if {[hm_tablelookup plot_table $elem_id] == 0} {
*appendmark elems 2 $elem_id
}
}
*splitelements 4 2
hm_markclear elems 1
hm_markclear nodes 1
hm_tableclearall
Errors
Incorrect usage results in a Tcl error. To
detect errors, you can use the catch
command:
if { [ catch {command_name...} ] } {
# Handle error
}