Model.hm_entityisdirty#
- Model.hm_entityisdirty(entity, dirtinessAspect='dirty_for_export')#
An automatic mechanism marks includes/modules dirty (modified) when they or entities belonging to them are changed. They get “cleaned” when exported (for includes) or saved as representations (for modules).
This query returns the dirtiness status of specified entity for a specific aspect. For checking the status of includes, use Model.hm_includeisdirty.
- Parameters:
entity (Entity) – The object describing the entity. Currently, only includes and modules are valid entity types.
dirtinessAspect (hwString) – Should always be set to “dirty_for_export”. Parameter exists to support other aspects in the future.
- Returns:
hwReturnStatus- Status objectHmQueryResult- Result object containing the output values:isDirty (int) - The status of an entity for the specified aspect.
0 - Not dirty.
1 - Dirty.
Example#
Ask whether part with name “Part1” is “dirty_for_export”#import hm import hm.entities as ent model = hm.Model() part = ent.Part(model, "Part1") _, result = model.hm_entityisdirty(entity=part, dirtinessAspect="dirty_for_export") print("Is the part dirty for export?", bool(result.isDirty))