Can you name an entity?

Discussion forum for C++ and script developers who are using the QCAD development platform or who are looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files, scripts and screenshots.

Post one question per topic.

Post Reply
bob
Newbie Member
Posts: 5
Joined: Tue Jun 14, 2022 5:14 pm

Can you name an entity?

Post by bob » Wed Jun 15, 2022 5:54 pm

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

User avatar
andrew
Site Admin
Posts: 9036
Joined: Fri Mar 30, 2007 6:07 am

Re: Can you name an entity?

Post by andrew » Wed Jun 15, 2022 5:59 pm

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.

Code: Select all

entity.getHandle()

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”