hm_createmark

Places entities on a mark based on user-supplied options.

Syntax

hm_createmark entity_type mark_id ?"by model" <model_name>? ?"option"? "list"

Type

HyperWorks Tcl Query Command

Description

This command will place entities of entity_type onto mark 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.

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.

The list of IDs, names, or parameters, depending on ?option?, must be quoted, e.g., "1 2 3" or defined using a Tcl list. When specifying entity names that contain spaces, group the name using brackets, e.g., {Comp name with spaces}, or use a Tcl list.

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

"advanced" "all"
Place all entities on mark_id.
"advanced" "displayed"
Place displayed entities on mark_id.
"advanced" "inactive"
Place only inactive entities on mark_id.
"advanced" "retrieve"
Place saved entities on mark_id. Some panels allow you to save entities. See the hm_saveusermark command as well.
"advanced" "reverse"
Entities existing on mark_id are removed. All other entities are put on mark_id.
"by all nodes" "ids"
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.
This is currently supported for nodes, elements, connectors, components (FE and connectors only), loads, equations, loadcols, systems, systcols, vectors, vectorcols, blocks, groups, sets, contactsurfs, points, lines, surfaces, solids and parts (FE and geom).
"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.
Valid configs for components are: mass, plot, weld, rigid, spring, joint, rigidlink, rbe3, bar, bar2, rod, bar3, gap, tria3, quad4, tria6, quad8, main3, main4, secondary3, secondary4, secondary1, tetra4, penta6, hex8, tetra10, penta15, hex20, pyramid5, and pyramid13.
Valid configs for loadcols are: force, moment, constraint, pressure, temperature, flux, velocity, acceleration, and equation.
"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.
Valid configs for components are: mass, plot, weld, rigid, spring, joint, rigidlink, rbe3, bar, bar2, rod, bar3, gap, tria3, quad4, tria6, quad8, main3, main4, secondary3, secondary4, secondary1, tetra4, penta6, hex8, tetra10, penta15, hex20, pyramid5, and pyramid13.
Valid configs for loadcols are: force, moment, constraint, pressure, temperature, flux, velocity, acceleration, and equation.
"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.
This is currently supported for nodes, elements, connectors, components (FE and connectors only), loads, equations, loadcols, systems, systcols, vectors, vectorcols, blocks, groups, sets, contactsurfs, points, lines, surfaces, solids and parts (FE and geom).
"by config" "configs"
Place entities on mark_id if they are of the specified config.
All element and load config names/IDs are valid.
"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.
If displayed_flag is 1, only displayed entities will be considered. Otherwise, all entities will be searched.
All element and load config names/IDs are valid.
"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.
This is currently supported for nodes, elements, connectors, components (FE and connectors only), loads, equations, loadcols, systems, systcols, vectors, vectorcols, blocks, groups, sets, contactsurfs, points, lines, surfaces, solids and parts (FE and geom).
"by domain" "ids"
Place entities on mark_id if they are referenced by the listed domain IDs.
Note that when selecting handles "by domain", all handles touching the domain and all those assigned to the domain will be selected.
"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 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:
domains - selects all domains which touch the selected handles or to which the selected handles are assigned.
handles - selects the handles linked to the selected handles by symmetry.
nodes - selects the nodes where each selected handle is located.
shapes - selects all shapes which contain a perturbation vector for the selected handles.
symmetries - selects all symmetries which link the selected handles to other handles.
"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 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 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 or equal to value" "name value"
Place entities on mark_id if they have associated metadata with the specified name and a value greater than or equal to value. This is valid for date, double, entityid and int 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 or equal to value" "name value"
Place entities on mark_id if they have associated metadata with the specified name and a value less than or equal to 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 type"
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 metadata value range" "name value_lower value_upper"
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 outside" "name value_lower value_upper"
Place entities on mark_id if they have associated metadata with the specified name and a value outside of 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 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 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.
"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 points" "ids"
Place entities on mark_id if they are referenced by the listed point 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 section"
"by sections"
"by section id"
"by section name"
Place entities on mark_id if they are referenced by the listed section 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 solid 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.
  • x - center x coordinate
  • y - center y coordinate
  • z - center z coordinate
  • r - radius
  • 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.
This is currently supported for nodes, elements, connectors, components (FE and connectors only), loads, equations, loadcols, systems, systcols, vectors, vectorcols, blocks, groups, sets, contactsurfs, points, lines, surfaces, solids and parts (FE and geom).
"by status" "attribute status"
Place entities on mark_id if they are 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 mark ID.
"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.
Multiple types can be specified. Valid types are as follows:
  • points
    • none (non-topological free point)
    • vertex
    • fixed
    • alltopo (vertex+fixed)
    • all
  • lines
    • none (non-topological free line)
    • free
    • shared
    • nonmanifold
    • suppressed
    • alltopo (free+shared+nonmanifold+suppressed)
    • all
  • surfaces
    • free (not part of a solid)
    • bounding
    • partition
    • fin
    • alltopo (bounding+partition+fin)
    • all
  • solids
    • 1dmappable
    • 3dmappable
    • unmappable
    • ignoredmappable
    • all
"by value range" "attribute_or_data_name value_lower value_upper"
Place entities on mark_id if they are 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 value range outside" "attribute_or_data_name value"
Place entities on mark_id if they have the specified data name or attribute name/ID with a value outside of the value_lower and value_upper range. 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 are 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. This is also valid for the first value comparison of entity array, integer array, real array, and string array attributes as well. Tcl regular expression syntax is used to specify the value.
For entity/integer/real values, value_type should be set to 0 (default if not specified). For string values, value_type must be set to 1.
"equal to value" "attribute_or_data_name value value_type"
Place entities on mark_id if they are 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.
For entity/integer/real values, value_type should be set to 0 (default if not specified). For string values, value_type must be set to 1.
"greater than or equal to 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 or equal to value. This is valid for entity, integer, and real data names and attributes only.
"greater than value" "attribute_or_data_name value"
Place entities on mark_id if they are 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.
"less than or equal to 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 or equal to value.
"less than value" "attribute_or_data_name value"
Place entities on mark_id if they are 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.
"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).
  • x - base x coordinate
  • y - base y coordinate
  • z - base z coordinate
  • i - normal x component
  • j - normal y component
  • k - normal z component
  • tol - tolerance to use to search for entities
If plane is 0, all entities must be within tol of the vector defined by (x, y, z, i, j, k). Otherwise, all entities must be within tol of the plane defined by (x, y, z, i, j, k).
If touching is 0, all points of the entity must touch the vector or plane. Otherwise, at least one point must touch the vector or plane. For solids, if touching is 0, no solids will be found.
{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. If so, the entire command must be wrapped in curly braces. The "tag" value can be defined in 3 ways:
  • - The full name, including label and body:
  • hm_createmark nodes 1 {tag="label1:body1" tag="label2:body2"}
  • - The label only, and any body:
  • hm_createmark nodes 1 {tag="label1:" tag="label2:"}
  • - The body only, and any label:
  • hm_createmark nodes 1 {tag=":body1" tag=":body2"}

Examples

To delete components with names FRONT and SIDE:

hm_createmark comps 1 "FRONT SIDE"
*deletemark comps 1

To delete components with names "Name with spaces" and SIDE:

hm_createmark comps 1 "{Name with spaces} SIDE"
*deletemark comps 1

or

set names [list {Name with spaces} SIDE]
hm_createmark comps 1 $names
*deletemark comps 1

To mark the last 3 components that were created:

hm_createmark comps 1 "by id only" "-1 -2 -3"

To delete all elements in the database:

hm_createmark elems 1 "advanced" "all"
*deletemark elems 1

To delete displayed elements:

hm_createmark elems 1 "advanced" "displayed"
*deletemark elems 1

To detach the elements (by .5) that failed the quality index (you must first use the save failed button in the quality index panel):

hm_createmark elems 1 "advanced" "retrieve"
*detachelements 1 .5

To delete all elements except the element with ID = 10:

hm_createmark elems 1 10
hm_createmark elems 1 "advanced" "reverse"
*deletemark elems 1

To set all inactive assemblies to active:

hm_createmark assems 1 "advanced" "inactive"
*marksuppressactive assems 1 0

To split all elements found in assemblies with IDs 10 and 20:

hm_createmark elems 1 "by assem id" "10 20"
*splitelements 1 1

To split all elements found in assemblies A and B:

hm_createmark elems 1 "by assem name" "A B"
*splitelements 1 1

To delete all systems in the system collector with ID 100:

hm_createmark systems 1 "by collector id" "100"
*deletemark systems 1

To delete all loads in load collector loadcol1:

hm_createmark loads 1 "by collector name" "loadcol1"
*deletemark loads 1

To change elements in component with ID 200 to 2nd order:

hm_createmark elems 1 "by comp id" "200"
*orderchangetosecond 1 0 0

To change elements in components named left and right to 2nd order:

set list "left right"
hm_createmark elems 1 "by comp name" "$list"
*orderchangetosecond 1 0 0

To place components X and Y on mark 1 and translate elements in these components by (5,0,0):

hm_createmark comps 1 "by name only" "X Y"
hm_createmark elems 1 "by comps on mark" 1
*createvector 1 1.0 0.0 0.0
*translatemark elements 1 1 5

To split all quad4 elements in the model:

hm_createmark elems 1 "by config" "quad4"
*splitelements 1 1

To mark all rigidlink elements that are of type RgdBody or ConNode. (The LsDyna template must be loaded.):

hm_createmark elems 1 "by config type" "1 rigidlink RgdBody ConNode"

To mark elements whose component references material with ID 50 or whose property references material with ID 50:

hm_createmark elems 1 "by material id" "50"

To mark elements that point to the property with name prop1 or, if no property is assigned to the element, whose component points to the property with name prop1:

hm_createmark elems 1 "by property name" "prop1"

To split all elements if their center is on the X-Y plane:

hm_createmark elems 1 "on plane" "0 0 0 0 0 1 .1 1 1"
*splitelements 1 1
To get a list of the elements referenced by outputblock OPB:
hm_createmark elems 1 "by outputblock name" "OPB"
set elem_list [hm_getmark elems 1]
To mark elements that share a face with elements 50 and 100 for model model-2:
hm_createmark elems 1 "by model" model-2 "50 100"
hm_appendmark elems 1 "by model" model-2 "advanced" "by face"

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

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".

2021.2 - Added new methods "by metadata greater than or equal to value", "by metadata less than or equal to value", "by metadata value range outside", "by value range outside", "greater than or equal to value" and "less than or equal to value". Enhanced the "contains value" method to support first value comparison of entity array, integer array, real array, and string array attributes.

2022Added new methods "by section", "by sections", "by section id" and "by section name". Added support for points, lines, surfaces, solids and parts (FE and geom) in the following methods: "by box", "by cone", "by cylinder" and "by sphere".

2024.1 - Removed methods “by multibody”, “by multibody id”, “by multibody name”, “by ellipsoid”, “by ellipsoid id”, “by ellipsoid name”, “by mbjoint”, “by mbjoint id”, “by mbjoint name”, “by mbplane”, “by mbplane id”, “by mbplane name”.