Can you name an entity?

I can create entities with a script and see them. Using queryAllEntities I can list them. Is it possible to give them names so that they can be referred to that way later in the script? Or should I be thinking about blocks? I haven’t yet found a way to create blocks (of entities) programmatically.

Bob

You can use the entity handle to reference entities. The handle is persistent, even when saving to DXF/DWG and later loading from DXF/DWG again.

entity.getHandle()