Rather than modifying the drawing why not just control the layers displayed in the Layer Properties Manager with Layer Filters?
Check out this link: https://cadtips.cadalyst.com/layer-tools/create-filter-all-layers-except-xref-layer?q=layer-tools/create-filter-all-layers-except-xref-layer
Our Civil 3D template has around 200 layers by itself so I load a collection of Layer Filters using this lisp to control the visible layers for whatever workflow I'm using at the time.
; (load "LayFilterAdd.lsp")
; ^C^C^P(or LayFilterAdd (load "LayFilterAdd.lsp"));(LayFilterAdd)
; Newer versions automatically display Xref Layer Filters **Adding Xref Layer Filter names the same as them can cause serious issues**
; Save, close and reopen the DWT or DWG for the Filters to be put into alphabetical order.
(defun LayFilterAdd (/ collection names)
; (load "LFD.lsp")
; (command "C:LFD" "All*") *Layers
(setq names (list ""))
(if (not (vl-catch-all-error-p (setq collection (vl-catch-all-apply
(function (lambda () (vla-item (vla-getextensiondictionary (vla-get-layers (vla-get-activedocument (vlax-get-acad-object)))) "ACAD_LAYERFILTERS")))
))))
; (vlax-for item collection (setq names (cons (strcase (vla-get-name item)) names))))
(vlax-for item collection (setq names (cons (vla-get-name item) names))))
names
(or(member "CALC Points" names)(command "._-layer" "filter" "new" "property" "All" "NAME==\"V-NODE-CALC\" or NAME== \"Layer*\"" "CALC Points" "X" nil))
(or(member "HATCH No xrefs" names)(command "._-layer" "filter" "new" "property" "All" "NAME==\"~*|*\" and NAME==\"*HATCH\"" "HATCH No xrefs" "X" nil))
(or(member "Linetype" names)(command "._-layer" "filter" "new" "property" "All" "LINETYPE==\"~Continuous\"" "Linetype" "X" nil))
(or(member "Lineweight" names)(command "._-layer" "filter" "new" "property" "All" "LINEWEIGHT==\"~Default\"" "Lineweight" "X" nil))
(or(member "NCS" names)(command "._-layer" "filter" "new" "property" "All" "NAME==\"[A,C,E,L,V]-*\" or NAME== \"Layer*\"" "NCS" "X" nil))
(or(member "NCS No xrefs" names)(command "._-layer" "filter" "new" "property" "All" "NAME==\"~*|*\" and NAME==\"[A,C,E,L,V]-*\" or NAME== \"Layer*\"" "NCS No xrefs" "X" nil))
(or(member "No NCS" names)(command "._-layer" "filter" "new" "property" "All" "NAME==\"~[A,C,E,L,V]-*\"" "No NCS" "X" nil))
(or(member "No NCS or xrefs" names)(command "._-layer" "filter" "new" "property" "All" "NAME==\"~*|*\" and NAME==\"~[A,C,E,L,V]-*\"" "No NCS or xrefs" "X" nil))
(or(member "No NODE" names)(command "._-layer" "filter" "new" "property" "All" "NAME==\"~*|*\" and NAME==\"[A,C,E,L,V]-*\" and NAME==\"~*-NODE*\" or NAME== \"Layer*\"" "No NODE" "X" nil))
(or(member "NODE" names)(command "._-layer" "filter" "new" "property" "All" "NAME==\"~*|*\" and NAME==\"[A,C,E,L,V]-*\" and NAME==\"*-NODE*\" or NAME== \"Layer*\"" "NODE" "X" nil))
(or(member "Profile" names)(command "._-layer" "filter" "new" "property" "All" "NAME==\"C-ROAD-PROF*\" or NAME== \"Layer*\"" "Profile" "X" nil))
(or(member "Sections" names)(command "._-layer" "filter" "new" "property" "All" "NAME==\"C-ROAD-SEC*\" or NAME== \"Layer*\"" "Sections" "X" nil))
(or(member "Topo" names)(command "._-layer" "filter" "new" "property" "All" "NAME==\"C-TOPO*\" or NAME== \"Layer*\"" "Topo" "X" nil))
(princ "Layer Filter Names » ")(princ names)
; (princ "\nSave, close and reopen the DWT or DWG for the Filters to be put into alphabetical order.")
(princ)
); function
(LayFilterAdd)
Quick, simple & easily manageable.