Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ImmutableEntityClass

A read-only view of an entity class. Returned by entity.entityClass — the class of a specific entity. Exposes all EntityClass fields as read-only; attempting to set any field raises an AttributeError.

ImmutableEntityClass is the superclass of EntityClass. Instances obtained from domain-level paths (e.g. domain.getEntityClassByName(name)) are full EntityClass objects and support mutation. Instances obtained through an entity are ImmutableEntityClass and do not.

To modify a class definition, look it up from the document rather than from an entity:

name = entity.entityClass.name        # read the name (fine via immutable ref)
cls = document.getDomainByName("Colors").getEntityClassByName(name)
cls.color = Color(1.0, 0.0, 0.0)     # modify via mutable EntityClass

Fields

All fields are read-only on ImmutableEntityClass.

FieldTypeDescription
namestringThe class name.
uuidstringRead-only. A unique identifier for this entity class.
builtInbooleanRead-only. True if the class is built-in and cannot be modified.
colorColorThe background color behind the class title.
nameColorColorRead-only. The color the class name is rendered in on an entity shape (auto-computed for contrast).
weightnumberThe default weight for new edges created with entities of this class, between -1.0 and 1.0.
symbolSymbolThe symbol inherited by new entities of this class.
milestonebooleanTrue if entities of this class are zero-effort milestone tasks.
resourceAssignmentResource Assignment TypeThe default resource assignment type for entities of this class.
showNamebooleanTrue if the class name is shown on entity shapes.
domainImmutableDomainRead-only. The parent domain of this class, also as a read-only reference.
filterUserDefinedAttributesbooleanRead-only. True if UDA visibility on entities of this class is restricted to the filter list.
userDefinedAttributesFilterListlist of stringRead-only. The UDA key names shown on entities of this class when filtering is enabled. Empty if no keys are set.