Author Topic: No plot in X-ref'susing lisp  (Read 1846 times)

0 Members and 1 Guest are viewing this topic.

TJAM51

  • Guest
No plot in X-ref'susing lisp
« 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)
  )

ronjonp

  • Needs a day job
  • Posts: 7529
Re: No plot in X-ref'susing lisp
« Reply #1 on: November 28, 2007, 10:02:04 AM »
Give this a try..:

Code: [Select]
(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)
)
« Last Edit: November 28, 2007, 10:28:36 AM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

TJAM51

  • Guest
Re: No plot in X-ref'susing lisp
« Reply #2 on: November 28, 2007, 10:35:15 AM »
 :-D :-D :-D :-D :-D :-D :-D :-D :-D :lmao: :lmao: :lmao:

OUTSTANDING......THANK YOU :lol: :lol: :lol:

ronjonp

  • Needs a day job
  • Posts: 7529
Re: No plot in X-ref'susing lisp
« Reply #3 on: November 28, 2007, 10:45:10 AM »
You're welcome :)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC