TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: TJAM51 on November 28, 2007, 09:53:25 AM
-
In a previous post I was give a really great routine (very thankful) that allows me to select layers in a drawing and they are set to no plot. The routine is below. Can this same routine be applied to X-ref's. Select the layers in the xref and those layers be turned to a no plot status. Thanks
;; selection to 'NO PLOT' mode
(defun C:NPL ()
(if (setq ss ( ssget))
(progn
(while (setq en (ssname ss 0))
(setq el (entget en)
ln (cdr (assoc 8 el)))
(if (not (member ln lst))
(setq lst (cons ln lst)))
(ssdel en ss)
)
(foreach ln lst
(setq el (entget (tblobjname "layer" ln)))
(if (zerop (cdr (assoc 290 el)))
(princ (strcat "\n Layer " ln " is already has 'no plot' status"))
(entmod (subst (cons 290 0)(assoc 290 el) el)))))
(princ "\n 0 selected")
)
(princ)
)
;; selection to 'PLOT' mode
(defun C:TPL ()
(if (setq ss ( ssget))
(progn
(while (setq en (ssname ss 0))
(setq el (entget en)
ln (cdr (assoc 8 el)))
(if (not (member ln lst))
(setq lst (cons ln lst)))
(ssdel en ss)
)
(foreach ln lst
(setq el (entget (tblobjname "layer" ln)))
(if (not (zerop (cdr (assoc 290 el))))
(entmod (subst (cons 290 0)(assoc 290 el) el))
(princ (strcat "\n Layer " ln " is already has 'no plot' status"))
)))
(princ "\n 0 selected")
)
(princ)
)
-
Give this a try..:
(defun c:nlaynp (/ e n lo)
(while (setq e (nentsel
"\nSelect object: "
)
)
(progn
(setq n (cdr (assoc 8 (entget (car e))))
lo (vlax-ename->vla-object (tblobjname "layer" n))
)
(vla-put-plottable lo :vlax-false)
(princ (strcat "\n" n " will not plot..."))
)
)
(princ)
)
-
:-D :-D :-D :-D :-D :-D :-D :-D :-D :lmao: :lmao: :lmao:
OUTSTANDING......THANK YOU :lol: :lol: :lol:
-
You're welcome :)