Returns information about entity bundles.
Syntax
hm_getentitybundleinfo
option ?arg1? ?arg2? ... ?argN?
Description
Returns information about entity bundles.
Inputs
- option ?arg1? ?arg2? ... ?argN?
- One of the following options:
- -list - Returns a Tcl array of the defined entity bundle
names
- -isdefined <name> - Returns true/false, if there is a bundle definition by that
name
- -definition <name> - Returns an array of the entity types for that bundle
definition
- -definition <name> <datanumber> - Returns the entity type for that data number
(starts from 0)
- -isinbundle <name> <datanumber> <id> - Returns true/false, if that entity is
in the bundle
- -anyinbundle <name> - Returns true/false, if there is anything in the bundle
- -anyinbundle <name> <datanumber> - Returns true/false, if there is anything in
that data of the bundle
- -count <name> <datanumber> - Returns how many entities are in that data of the
bundle
- -getids <name> <datanumber> - Returns a Tcl array of that
data of the bundle
- -markids <name> <datanumber> <mark> - Adds the entities of that data of the
bundle to the specified mark
Example
To return the list of entity types, in order, that constitute the definition of the bundle
named "material bundle":
hm_getentitybundleinfo -definition "material bundle"
To find the bundle named "material bundle" and answer "true" if there is any entity stored
in its first data
item:
hm_getentitybundleinfo -anyinbundle "material bundle" 0
To find the bundle named "material bundle" and return a
Tcl list of the
IDs stored in its first data
item:
hm_getentitybundleinfo -getids "material bundle" 0
Errors
Incorrect usage results in a
Tcl error. To
detect errors, you can use the
catch
command:
if { [ catch {command_name...} ] } {
# Handle error
}