*createmark
Places entities on a mark based on user-supplied options.
Syntax
*createmark entity_type mark_id ?"by model" <model_name>? ?"option"? list
Type
HyperMesh Tcl Modify Command
Description
This command will place entities of entity_type onto mark_id. Valid mark_ids are 1 and 2. Depending on the options specified, the supported entity_types will change.
All options only return entities that are defined as active in the database, unless otherwise noted.
If no ?option? is specified, "by name only" is used for entities with names. Otherwise, "by id only" is used. This can be specified using the command hm_marksearchmode.
If no ?option? is specified, both active and inactive entities may be selected.
For options that allow both "ids or names" in the list, entities are found first using names. Entities not found using names are then found using IDs. This order can be specified using the command hm_marksearchmode.
When specifying entity names that contain spaces, group the name using brackets, {Comp name with spaces}, or use a Tcl list.
When specifying the list using a Tcl variable, the eval Tcl command must precede the *createmark command (see example below). This expands (substitutes) the Tcl list before executing the command. It is also important to use brackets around any options that contain spaces when using eval (eval *createmark solids 1 {"by comp name"} $comp_names). Otherwise, the quotes will be expanded before the option reaches the *createmark command and it will not function as expected.
Negative values can be used to find recently created entities (see example below). This functionality selects entities in the reverse order they are stored in the database (the order they are created, regardless of ID). However, any operations that affect the order of entities in the database (organize, reorder, etc.) will change the returned/selected entities. It is recommended to use this option only immediately after entity creation and before any other operations that may modify the database.
Inputs
- entity_type
- Entity type to use. Depending on the options specified, the supported entity types will change.
- mark_id
- The ID of the mark. Valid values are 1 and 2.
- "by model" <model_name>
- The optional model to create the mark from. If not specified, the current model is used.
- ?"options"?
Supported Options
- "all"
- Place all entities on mark_id.
- "displayed"
- Place all entities on mark_id.
- "inactive"
- Place all entities on mark_id.
- "retrieve"
- Place saved entities on mark_id. Some panels allow you to save entities. See the *saveusermark command, as well.
- "reverse"
- Entities existing on mark_id are removed. All other entities are put on mark_id.
- "by all nodes" id
- Place elements on mark_id that consist of all the listed node IDs.
- "by assem" ids or names
- "by assem id" ids
- "by assem name" names
- "by assembly" ids or names
- "by assembly id" ids
- "by assembly name" names
- Place entities on mark_id, if they are referenced by the listed assembly IDs or names.
- "by attribute" attribute
- Place entities on mark_id, if they have the specified attribute name/ID.
- "by block" ids or names
- "by block id" ids
- "by block name" names
- Place entities on mark_id, if they are displayed within the bounds of the listed block IDs or names. The smaller of the global node tolerance, or 1/200 of the smallest block dimension, is used for the selection tolerance.
- "by box" x0 y0 z0 x1 y1 z1 syst location contained all tol
- Place entities on mark_id, if they are inside/outside/on the
boundary of the box.
- x0 - lower bound x coordinate.
- y0 - lower bound y coordinate.
- z0 - lower bound z coordinate.
- x1 - upper bound x coordinate.
- y1 - upper bound y coordinate.
- z1 - upper bound z coordinate.
- syst - the ID of a local coordinate system to which the coordinate bounds are relative to. If 0, the global axes are used.
- location - The location of the entities to find, relative to the shape. Valid values are inside, outside, boundary and acrossboundary.
- contained - A flag that indicates whether the entire entity should meet the location criteria (1) or just any part of the entity (0) to be selected.
- all - A flag that indicates whether all entities (1) or only displayed entities (0) are considered for selection.
- tol - The tolerance to use. In most cases, this should be set to 0.
- "by box entity" ids or names
- "by box entity id" ids
- "by box entity name" names
- Place entities on mark_id, if they are displayed within the bounds of the listed box IDs or names. The smaller of the global node tolerance, or 1/200 of the smallest block dimension, is used for the selection tolerance.
- "by card image name" name
- Place entities on mark_id if they have the specified card image name assigned to them. One name can be specified per call.
- "by card image type" type
- Place entities on mark_id if they have a card image assigned to them of the specified card image type. One type can be specified per call. Currently supported for mats and props.
- "by collected config" configs
- Place entities on mark_id if they contain entities of the specified config.
- "by collected config type" config ?type1? ?type2? ?…?
- Place entities on mark_id if they contain entities of the specified config and type. One config can be specified per call, with multiple optional types. The types listed must match the types found in the current template (the type name does not have to match upper/lower case). If there is no current template, no entities will be marked.
- "by collector" ids or names
- "by collector id" ids
- "by collector name" names
- Place entities on mark_id if they are referenced by the listed collector ids or names.
- "by comp" ids or names
- "by comp id" ids
- "by comp name" names
- "by component" ids or names
- "by component id" ids
- "by component name" names
- Place entities on mark_id if they are referenced by the listed component ids or names.
- "by comps on mark" markId
- Place entities on mark_id if they are referenced by the listed components contained on markId.
- "by cone" x y z i j k rb rt h location contained all tol
- Place entities on mark_id if they are inside/outside/on the
boundary of the cone.
- x - base center x coordinate
- y - base center y coordinate
- z - base center z coordinate
- i - x-normal, x-coordinate of a point on the cylinder axis
- j - y-normal, y-coordinate of a point on the cylinder axis
- k - z-normal, z-coordinate of a point on the cylinder axis
- rb - radius at the cone base
- rt - radius at the cone top
- h - height. A negative value indicates the direction is opposite to the normal vector.
- location - The location of the entities to find, relative to the shape. Valid values are inside, outside, boundary and acrossboundary.
- contained - A flag that indicates whether the entire entity should meet the location criteria (1) or just any part of the entity (0) to be selected.
- all - A flag that indicates whether all entities (1) or only displayed entities (0) are considered for selection.
- tol - The tolerance to use. In most cases, this should be set to 0.
- "by config" configs
- Place entities on mark_id if they are of the specified config.
- "by config type" displayed_flag config ?type1? type2? ?…?
- Place entities on mark_id if they are of the specified config and type(s). One config can be specified per call, with multiple optional types. The types listed are the type name(s) and must match the types found in the current template (the type name does not have to match upper/lower case). If there is no current template, no entities will be marked.
- "by cylinder" x y z i j k r h location contained all tol
- Place entities on mark_id if they are inside/outside/on the
boundary of the cylinder.
- x - base center x coordinate
- y - base center y coordinate
- z - base center z coordinate
- i - x-normal, x-coordinate of a point on the cylinder axis
- j - y-normal, y-coordinate of a point on the cylinder axis
- k - z-normal, z-coordinate of a point on the cylinder axis
- r - radius
- h - height. A negative value indicates the direction is opposite to the normal vector.
- location - The location of the entities to find, relative to the shape. Valid values are inside, outside, boundary and acrossboundary.
- contained - A flag that indicates whether the entire entity should meet the location criteria (1) or just any part of the entity (0) to be selected.
- all - A flag that indicates whether all entities (1) or only displayed entities (0) are considered for selection.
- tol - The tolerance to use. In most cases, this should be set to 0.
- "by domain" ids
- Place entities on mark_id if they are referenced by the listed domain ids.
- "by elem" ids
- "by elem id" ids
- "by element" ids
- "by element id" ids
- Place entities on mark_id if they are referenced by the listed element IDs.
- "by ellipsoid" ids or names
- "by ellipsoid id" ids
- "by ellipsoid name" names
- Place entities on mark_id if they are referenced by the listed ellipsoid IDs or names.
- "by group" ids or names
- "by group id" ids
- "by group name" names
- Place entities on mark_id if they are referenced by the listed group IDs or names.
- "by handle" ids
- Place entities on mark_id using the following criteria:
- "by id only" ids
- Place entities on mark_id with the listed entity IDs. Some entities (such as components) can be listed by name or by ID. If you are listing by ID, use the "by id only" option. This option will select both active and inactive entities.
- "by include" ids
- Place entities on mark_id if they are inside the include file with ID ids.
- "by include shortname" names
- Place entities on mark_id if they are inside the include file with short name names.
- "by laminate" ids or names
- "by laminate id" ids
- "by laminate name" names
- Place entities on mark_id if they are referenced by the listed laminate IDs or names.
- "by lines" ids
- Place entities on mark_id if they are referenced by the listed line IDs.
- "by list" ids or names
- "by list id" ids
- "by list name" names
- Place entities on mark_id if they are referenced by the listed list IDs or names.
- "by material" ids or names
- "by material id" ids
- "by material name" names
- Place entities on mark_id if they are referenced by the listed material IDs or names.
- "by mbjoint" ids or names
- "by mbjoint id" ids
- "by mbjoint name" names
- Place entities on mark_id if they are referenced by the listed mbjoint IDs or names.
- "by mbplane" ids or names
- "by mbplane id" ids
- "by mbplane name" names
- Place entities on mark_id if they are referenced by the listed mbplane IDs or names.
- "by metadata name" names
- Place entities on mark_id if they have associated metadata with any of the specified names. Valid for all metadata types.
- "by metadata contains value" name value
- Place entities on mark_id if they have associated metadata with the specified name and a value that contains value. This is valid for all metadata types.
- "by metadata equal to value" name value
- Place entities on mark_id if they have associated metadata with the specified name and a value that exactly matches value. This is valid for all metadata types.
- "by metadata greater than value" name value
- Place entities on mark_id if they have associated metadata with the specified name and a value greater than value. This is valid for date, double, entityid and int metadata types.
- "by metadata less than value" name value
- Place entities on mark_id if they have associated metadata with the specified name and a value less than value. This is valid for date, double, entityid and int metadata types.
- "by metadata type" name value
- Place entities on mark_id if they have associated metadata with the specified name and a type equal to type. This is valid for date, double, entityid and int metadata types.
- "by metadata value range" name value_lower value_upper
- Place entities on mark_id if they have associated metadata with the specified name and a value between or equal to value_lower and value_upper. This is valid for all metadata types (date, double, doublearray, entityid, entityidarray, int, intarray, string, stringarray).
- "by module" ids or names
- "by module id" ids
- "by module name" names
- Place entities on mark_id if they are referenced by the listed module IDs or names.
- "by morph vols" ids
- Place entities on mark_id if they are referenced by the listed morphvolume IDs.
- "by multibody" ids or names
- "by multibody id" ids
- "by multibody name" names
- Place entities on mark_id if they are referenced by the listed multibody IDs or names.
- "by name only" names
- Place entities on mark_id with the listed entity names. Some entities (such as components) can be listed by name or by ID. If you are listing by name, use the "by name only" option. This option will select both active and inactive entities..
- "by node" ids
- "by node id" ids
- Place entities on mark_id if they are referenced by the listed node IDs.
- "by outputblock" ids or names
- "by outputblock id" ids
- "by outputblock name" names
- Place entities on mark_id if they are referenced by the listed outputblock IDs or names.
- "by plot" ids or names
- "by plot id" ids
- "by plot name" names
- Place entities on mark_id if they are referenced by the listed plot IDs or names.
- "by ply" ids or names
- "by ply id" ids
- "by ply name" names
- Place entities on mark_id if they are referenced by the listed ply IDs or names. Valid for elements, laminates, materials and sets.
- "by points" ids
- Place entities on mark_id if they are referenced by the listed points IDs.
- "by property" ids or names
- "by property id" ids
- "by property name" names
- Place entities on mark_id if they are referenced by the listed property IDs or names.
- "by set" ids or names
- "by set id" ids
- "by set name" names
- Place entities on mark_id if they are referenced by the listed set IDs or names.
- "by solids" ids
- Place entities on mark_id if they are referenced by the listed solids IDs.
- "by sphere" x y z r location contained all tol
- Place entities on mark_id if they are inside/outside/on the boundary of the sphere.
- "by status" attribute status
- Place entities on mark_id if they have the specified attribute name/ID with a status that equals the specified status. This is valid for integer, real and string attributes only.
- "by subsystem" ids or names
- "by subsystem id" ids
- "by subsystem name" names
- Place entities on mark_id if they are referenced by the listed subsystem IDs or names.
- "by surface" ids
- Place entities on mark_id if they are referenced by the listed surface IDs.
- "by surface on mark" markId
- Place entities on mark_id if they are referenced by the listed surfaces contained on markId.
- "by system" ids
- "by system id" ids
- Place entities on mark_id if they are referenced by the listed system IDs.
- "by topology" types
- Place entities on mark_id if they are of the specified type.
- "by value range" attribute_or_data_name value_lower value_upper
- Place entities on mark_id if they have the specified data name or attribute name/ID with a value between or equal to value_lower and value_upper. This is valid for entity, integer and real data names and attributes only.
- "by visible"
- Place entities on mark_id if they are visible (based on pixels). Currently only supported for elems. Not available in batch mode.
- "contains value" attribute_or_data_name value value_type
- Place entities on mark_id if they have the specified data name or attribute name/ID with a value that contains value. This is valid for entity, integer, real and string data names and attributes only. Tcl regular expression syntax is used to specify the value.
- "equal to value" attribute_or_data_name value value_type
- Place entities on mark_id if they have the specified data name or attribute name/ID with a value that exactly matches value. This is valid for entity, integer, real and string data names and attributes only.
- "greater than value" attribute_or_data_name value
- Place entities on mark_id if they have the specified data name or attribute name/ID with a value that is greater than (but not equal to) value. This is valid for entity, integer and real data names and attributes only.
- "less than value" attribute_or_data_name value
- Place entities on mark_id if they have the specified data name or attribute name/ID with a value that is less than (but not equal to) value. This is valid for entity, integer and real data names and attributes only.
- "on plane" x y z i j k tol plane touching
- Place entities on mark_id if they are within tol of the plane or vector defined by (x, y, z, i, j, k).
- tag="tag1" tag="tag2" etc.
- Place entities on mark_id if they have the specified tag associated
with them. Multiple tag= options can be used at once. The "tag" value can be defined in
3 ways:
- The full name, including label and body:
- *createmark nodes 1 tag="label1:body1" tag="label2:body2"
- The label only, and any body:
- *createmark nodes 1 tag="label1:" tag="label2:"
- The body only, and any label:
- *createmark nodes 1 tag=":body1" tag=":body2"
- The full name, including label and body:
Examples
*createmark comps 1 FRONT SIDE
*deletemark comps 1
*createmark comps 1 {Name with spaces} SIDE
*deletemark comps 1
orset names [list {Name with spaces} SIDE]
eval *createmark comps 1 $names
*deletemark comps 1
*createmark comps 1 -1 -2 -3
*createmark elems 1 "all"
*deletemark elems 1
*createmark elems 1 "displayed"
*deletemark elems 1
*createmark elems 1 "retrieve"
*detachelements 1 .5
*createmark elems 1 10
*createmark elems 1 "reverse"
*deletemark elems 1
*createmark assems 1 "inactive"
*setvalue assems mark=1 activesuppressed=0
*createmark elems 1 "by assem id" 10 20
*splitelements 1 1
*createmark elems 1 "by assem name" A B
*splitelements 1 1
*createmark systems 1 "by collector id" 100
*deletemark systems 1
*createmark loads 1 "by collector name" loadcol1
*deletemark loads 1
*createmark elems 1 "by comp id" 200
*orderchangetosecond 1 0 0
set list "left right"
eval *createmark elems 1 "by comp name" $list
*orderchangetosecond 1 0 0
*createmark comps 1 "by name only" X Y
*createmark elems 1 "by comps on mark" 1
*createvector 1 1.0 0.0 0.0
*translatemark elements 1 1 5
*createmark elems 1 "by config" quad4
*splitelements 1 1
*createmark elems 1 "by config type" 1 rigidlink RgdBody ConNode
*createmark elems 1 "by material id" 50
*createmark elems 1 "by property name" prop1
*createmark elems 1 "on plane" 0 0 0 0 0 1 .1 1 1
*splitelements 1 1
*createmark elems 1 "by outputblock name" OPB
set elem_list [hm_getmark elems 1]
*createmark elems 1 "by model" model-2 50 100
*appendmark elems 1 "by model" model-2 "by face"
Errors
if { [ catch {command_name...} ] } {
# Handle error
}
Version History
2017.1 - Added new "by topology" method.
2020 - Added new methods "by list", "by list id" and "by list name". Added new option "by model".
2020.1 - Added new methods "by subsystem", "by subsystem id" and "by subsystem name".