The standard command ERASE allows to interactively select the objects-to-be-erased only from the current layout, model- or paperspace.
If you want to select and erase a given object type - e.g. a specific block or texts containing a specific string - in all layouts of your curretn DWG drawing, use the following LISP utility DelInLo. Build the selection filter using the LISP function (ssget), or make use of the interactive function (ssx) from Express Tools.
; Delete in all layouts, www.cadstudio.cz 2019
(defun C:DelInLo ( / ss)
(vl-load-com)
(load "SSX.LSP" "Express Tools not installed")
(princ "\nSelect objects to delete in all layouts, by a filter or example")
(if (setq ss (ssx))
(foreach x (mapcar 'cadr (ssnamex ss))(vla-delete (vlax-ename->vla-object x)))
)
(princ)
)
(princ "\nDelInLo command loaded.")(princ)
Save the LISP code above to the file DelInLo.lsp (or download it from Download), load it into your AutoCAD with APPLOAD and type the command DELINLO. Use the filter to select the requested objects to delete.
We recommend first to update the filtering function SSX from Express Tools with our extended version, with the tool SSX, which can be downloaded from Download - the copy it to the folder "Express" in your AutoCAD installation.