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.
| Field | Type | Description |
|---|---|---|
name | string | The class name. |
uuid | string | Read-only. A unique identifier for this entity class. |
builtIn | boolean | Read-only. True if the class is built-in and cannot be modified. |
color | Color | The background color behind the class title. |
nameColor | Color | Read-only. The color the class name is rendered in on an entity shape (auto-computed for contrast). |
weight | number | The default weight for new edges created with entities of this class, between -1.0 and 1.0. |
symbol | Symbol | The symbol inherited by new entities of this class. |
milestone | boolean | True if entities of this class are zero-effort milestone tasks. |
resourceAssignment | Resource Assignment Type | The default resource assignment type for entities of this class. |
showName | boolean | True if the class name is shown on entity shapes. |
domain | ImmutableDomain | Read-only. The parent domain of this class, also as a read-only reference. |
filterUserDefinedAttributes | boolean | Read-only. True if UDA visibility on entities of this class is restricted to the filter list. |
userDefinedAttributesFilterList | list of string | Read-only. The UDA key names shown on entities of this class when filtering is enabled. Empty if no keys are set. |