Here is an example of what @Kent1Cooper meant.
It changes every entity within a block definition to color ByBlock, which then allows a block insertion (reference) to have its color changed, independent of layer color, which is most prevalent by AutoCAD users.
(defun C:BB ( / *error* @reset |e |e0 |ent |etyp |done |bname |ans |flag)
;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
;* *
;* BB.LSP by John F. Uhden *
;* 2 Village Road *
;* Sea Girt, NJ 08750 *
;* *
;* *
;* * * * * * * * * * * * Do not delete this heading! * * * * * * * * * * * *
; Program redefines all entities in a block definition to color BYBLOCK.
; v2.1 (10-24-97) corrected (redraw) and (chr 7)
; v15.00 (04-07-00) for R15
; v16.0 (02-10-2020) revised as freeware for Challoner, using R16
(gc)
(prompt "\nBB v16.0 (c)1994-2020, John F. Uhden")
(prompt "\nThis routine will redefine all entities in a block to color BYBLOCK.")
(vl-doc-set '$cv_cmdname (getvar "cmdnames"))
(defun *error* (error)
(mapcar 'setvar vars vals)
(vla-endundomark *doc*)
(cond
(not error)
((wcmatch (strcase error) "*CANCEL*,*QUIT*")
(vl-exit-with-error "\r ")
)
(1 (vl-exit-with-error (strcat "\r*ERROR*: " error)))
)
(princ)
)
;;------------------------------------------
;; Intitialze drawing and program variables:
;;
(setq *acad* (vlax-get-acad-object))
(setq *doc* (vlax-get *acad* 'ActiveDocument))
(vla-endundomark *doc*)
(vla-startundomark *doc*)
(setq vars '("cmdecho" "highlight"))
(setq vals (mapcar 'getvar vars))
(mapcar 'setvar vars '(0 1))
(command "_.expert" (getvar "expert")) ;; dummy command
(if (setq |e0 (entsel "\nPick a block to redefine: "))
(progn
(setq |e0 (car |e0)
|ent (entget |e0)
|etyp (cdr (assoc 0 |ent))
|flag (cdr (assoc 70 |ent))
)
(redraw |e0 3)
(if (and (= |etyp "INSERT")(= (logand |flag 4) 4))
(setq |etyp "Xref")
)
(if (= |etyp "INSERT")
(progn
(setq |bname (cdr (assoc 2 |ent))
|e (tblsearch "block" |bname)
|e (cdr (assoc -2 |e)) |done nil
)
(prompt (strcat "\nBlock name is " |bname "."))
(initget "Yes No")
(setq |ans (getkword "\nAre you sure you want to redefine it? Yes/<No>: "))
(if (= |ans "Yes")
(progn
(while (not |done)
(setq |ent (entget |e))
(if (assoc 62 |ent)
(setq |ent (subst (cons 62 0)(assoc 62 |ent) |ent))
(setq |ent (append |ent (list (cons 62 0))))
)
(entmod |ent)(entupd |e)
(if (not (setq |e (entnext |e)))(setq |done 1))
)
(prompt "\nDisplay will be correct after next regen.\n")
)
)
)
(prompt (strcat "\nEntity selected is a(n) " |etyp "."))
)
(setq |e0 (redraw |e0 4))
)
)
(*error* nil)
)