One problem with blocks in AutoCAD, including xrefs, is that it is easy to select a component during editing commands that ends up affecting the entire block. One way to avoid this is to lock the layer on which the block/xref resides, but this is not always possible or desired. This routine from Leland Leahy is an alternative to the normal Erase command — it filters out xrefs from the selection so that they are not erased. With a little modification, the same principle could apply to any entity type. Start by loading the LISP file, then type in the command SafeErase. Proceed just as if you were using the built-in Erase command, and if any xref entities are selected, they will be omitted from the selection before the erase action occurs. |