hm_latestentityid

Returns the ID of the last created entity

Syntax

hm_latestentityid entity_type ?num?

Type

HyperMesh Tcl Query Command

Description

Returns the ID of the last created entity. An option is also available to return the ID of previously created entities (up to 99).

Inputs

entity_type
The type of entity to return the last created ID for.
num (optional)
Queries a specific entity created previously before the last entity. The max is 99. Default is 0 (last entity).

Examples

To get the latest created component:

hm_latestentityid comps

To get the previous latest and first previous 10th created component:

*createmark lines 1 100
#Create two nodes on the line
*nodecreateonlines lines 1 2 0 0
#Get the last created node
set node1 [hm_latestentityid nodes]
#Get the first previously created node
set node2 [hm_latestentityid nodes]

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

12.0