Model.hm_metadata_byname#
- Model.hm_metadata_byname(name, entity_type=EntityFullType()))#
Returns all metadata with the specified name. If
entity_typeis specified, all metadata with the specified name and attached to that entity type is returned.- Parameters:
name (hwString) – The name of the metadata entities to return the metadata.
entity_type (EntityFullType) – The entity type to filter the metadata by.
- Returns:
hwReturnStatus- Status objectHmQueryResultList- Result list object containingHmQueryResultobjects with the following output data:entity (Entity) - The entity to which the metadata is attached.
name (hwString) - The name of the metadata.
value (Union[bool, str, float, int, list, numpy.ndarray, Entity, EntityList]) - The value of the metadata.
Examples#
Find all metadata named .ALTAIR.HW.CATIA.TAG#import hm import hm.entities as ent model = hm.Model() _, resultlist = model.hm_metadata_byname(name=".ALTAIR.HW.CATIA.TAG") for result in resultlist: print("Entity Class:", result.entity.__class__.__name__, "| Entity ID:", result.entity.id, "| Metadata Name:", result.name, "| Metadata Value:", result.value)
Find all metadata named .ALTAIR.HW.CATIA.TAG attached to surfaces#import hm import hm.entities as ent model = hm.Model() _, resultlist = model.hm_metadata_byname(name=".ALTAIR.HW.CATIA.TAG", entity_type=ent.Surface) for result in resultlist: print("Entity ID:", result.entity.id, "| Metadata Name:", result.name, "| Metadata Value:", result.value)