hi all,
I found this lisp and it works pretty good, except that I would like to
change so I have an option of which color to use. If that is too difficult,
I would like to modify it so I can use color 8, but I can't seem to find
where I can change the color from 9 to 8. If you can point that out to me
least, I will really appreciate it.
Thanks,
Connie
;;;;;;;;;;;;;;;;;
;;CADALYST 08/03 Tip1888: XREFTO9.LSP XREFS TO COLOR 9 (c) 2003 Jeff
Mishler
; Routine to set all model space Xref ;layers to color 9
; ; by Jeff Mishler, 5/3/03
(defun C:XR9 (/ ssblk cnt blknames lay ename)
(setq ssblk (ssget "x" '((0 . "INSERT") (410 . "Model"))))
(setq cnt 0)
(setq blknames "")
(repeat (sslength ssblk) ; create list of block names in Model space for
filter list
(setq blknames (strcat blknames
(cdr (assoc 2 (entget (ssname ssblk cnt))))
"|*,"
)
)
(setq cnt (1+ cnt))
)
(setq lay (tblnext "layer" t)) ;get layer entity
(command "undo" "be")
(while (/= lay nil)
(if (wcmatch (cdr (assoc 2 lay)) blknames)
;find xref layers, could use assoc 70 instead
(progn
(setq ename (tblobjname "layer" (cdr (assoc 2 lay))))
(setq lay (entget ename))
(if (> (cdr (assoc 62 lay)) 0) ; is the layer on?
(setq lay (subst (cons 62 9) (assoc 62 lay) lay)) ; yes it is
(setq lay (subst (cons 62 -9) (assoc 62 lay) lay))
; no, it's off
)
(entmod lay)
)
)
(setq lay (tblnext "layer")) ; next layer
)
(if ename
(prompt
"All xref layers in Model space (except \"0\" and \"defpoints\") now
color 9!"
)
(prompt "No xref layers found in Model Space!")
)
(command "undo" "end")
(princ)
)