hm_defined

Queries whether an attribute or metadata is defined on an entity.

Syntax

hm_defined entity_type entity_name_or_id attribute_or_metadata_name queryType searchType

Type

HyperMesh Tcl Query Command

Description

Queries whether an attribute or metadata is defined on an entity.

Inputs

entity_type
The type of the queried entity.
entity_name_or_id
The name or ID of the queried entity.
attribute_or_metadata_name
The name of the attribute or the metadata.
queryType
By default, HyperMesh queries the entity attributes/data names. This option allows you to specify to query the entity metadata. The option is:

-metadata: query metadata.

searchType
By default, HyperMesh searches for entities by name, and if the name is not found, it then searches by ID. This option allows you to specify how the search for an entity should be conducted. The two options are:
-byname: search only by name
-byid: search only by ID

Example

If the attribute or metadata with the given name is defined on this entity, the function returns 1; otherwise, it returns 0.

If it cannot find the attribute or metadata on the current entity, @defined will also check the dictionaries; hm_defined will not do that because the dictionaries cannot be accessed outside of the template.

Errors

None.

Version History

2023.1 - Added new argument queryType.