when undo, how can get type of entity?
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
-
- Active Member
- Posts: 33
- Joined: Thu Jan 14, 2016 4:17 am
when undo, how can get type of entity?
when an entity is selected, its' type can be acquired easily. However, when an entity is undid or redid(in the 'Edit' menu), how to get its' type? Thanks!
Re: when undo, how can get type of entity?
The undone status is just a flag of the object (entity in this case). You can get it the same way as for a regular entity (getType or through dynamic_cast).
-
- Active Member
- Posts: 33
- Joined: Thu Jan 14, 2016 4:17 am
Re: when undo, how can get type of entity?
if a block is deleted, then undo, can the name of block be got? how? thanks!
Re: when undo, how can get type of entity?
If you want to be notified the deletion of a block, you'd best implement an RTransactionListener. You can find an example at: https://github.com/qcad/qcad/blob/maste ... istener.js
Transaction listeners are notified whenever 'something changes' (object added, object modified, object deleted), also during undo / redo.
Transaction listeners are notified whenever 'something changes' (object added, object modified, object deleted), also during undo / redo.