Model.hm_modent_getrepresentationdefinitions#
- Model.hm_modent_getrepresentationdefinitions(collection, ignoretransient=1, libraryinfo=0, attribute='')#
Returns the number of subsystem entity representations available, and those realized. They are returned by their representation keys (identifier).
- Parameters:
collection (Collection) – The collection containing the entities. Supported only for subsystem entities.
ignoretransient (unsigned int) –
0 - Return all representations.
1 - Return only representations saved as files.
libraryinfo (unsigned int) –
0 - No library info provided.
1 - Return library information regarding specific representation.
attribute (hwString) – Reserved for future development.
- Returns:
hwReturnStatus- Status objectHmQueryResultList- Result list object containingHmQueryResultobjects with the following output data:representationName (str) - The name of the representation.
numberOfAvailable (int) - The number of available representations.
isRealized (bool) - Whether the representation is realized.
If
libraryinfo=1, the result objects contain additional keys:inLibrary (int) - Indicates if the representation is in the library (1) or not (0).
Example#
Get the saved representations that are available, and those realized, for subsystems on collection#import hm import hm.entities as ent model = hm.Model() subsystems = hm.Collection(model, ent.Subsystem, [4, 6, 8]) _, resultlist = model.hm_modent_getrepresentationdefinitions( collection=subsystems, ignoretransient=0, libraryinfo=0 ) for result in resultlist: print("representationName: ", result.representationName) print("numberOfAvailable: ", result.numberOfAvailable) print("isRealized: ", result.isRealized)