(entdel entity-name)
Erase that entity from the drawing.
This function deletes an entity (or entity) specified by entity-name if it exists in the drawing. Use the entnext or entget functions to get the entity's entity-name.
If the entity was deleted from the drawing earlier in the current editing session, the entity is restored. In other words, using entdel twice un-deletes the entity. This works until you exit the drawing. Once the drawing is reloaded, you can no longer use entdel to restore entities deleted in the previous drawing session.
Example
Code | Results |
---|---|
(setq a (entnext)) | |
(entdel a) | Delete entity. |
(entdel a) | Undelete entity. |
NOTES
- Only entities can be deleted with entdel, not attributes or polyline vertices. To delete attributes and polyline vertices, use the command function with the AttEdit and PEdit commands.
- Entities within blocks may not be deleted. To delete entities within a block, use entmake to redefine the block without the entities you want erased.