Author Topic: Setting layers to no plot using lisp  (Read 3400 times)

0 Members and 1 Guest are viewing this topic.

TJAM51

  • Guest
Setting layers to no plot using lisp
« on: November 26, 2007, 07:54:38 AM »
Is there any way to use lisp to select a layer through crossing or window or simply pick and set that layer as a non plot status? Thanks....

Fatty

  • Guest
Re: Setting layers to no plot using lisp
« Reply #1 on: November 26, 2007, 08:50:16 AM »
Give that a try

Code: [Select]
;; 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)
  )

~'J'~

TJAM51

  • Guest
Re: Setting layers to no plot using lisp
« Reply #2 on: November 26, 2007, 08:55:04 AM »
Thanks so much..really cool...again thank you :-D

Fatty

  • Guest
Re: Setting layers to no plot using lisp
« Reply #3 on: November 26, 2007, 01:57:39 PM »
Glad you got it to work
Cheers :)

~'J'~