Author Topic: List Layers Freezer  (Read 1071 times)

0 Members and 1 Guest are viewing this topic.

amc.dicsac

  • Newt
  • Posts: 109
  • Autocad 2008
List Layers Freezer
« on: September 23, 2016, 01:16:22 PM »
Hi I need help, I have the following code,  that return the layers list that are not unlocked, the defpoint layer and the layers of the xref, my problem is I want to add an option of not show the frozen layers and off.

Thanks.

Code - Auto/Visual Lisp: [Select]
  1. ;;;-----------------------------
  2. ;;;by José Luis Garcia Galán
  3. ;;;LaMarmita
  4. ;;----------------------------------
  5. (defun lisLayerDoc ( / tbldata table_list just_name)
  6.  (while (setq tbldata (tblnext "LAYER" (not tbldata)))
  7.   (setq just_name (cdr (assoc 2 tbldata)))
  8.   (cond
  9.    ; El nombre no es nulo
  10.    ((= "" just_name))
  11.    ;;No listar la capa "DEFPOINTS"
  12.    ((= "DEFPOINTS" (strcase just_name)))
  13.    ;;esta bloqueada
  14.    ((= 4 (logand 4 (cdr (assoc 70 tbldata)))))
  15.    ;;capa de Xref
  16.    ((not (zerop (logand 48 (cdr (assoc 70 tbldata))))))
  17.    ;;Valida
  18.    (T (setq table_list (acad_strlsort (cons just_name table_list))))
  19.   )
  20.  );c.while
  21.  (setq table_list table_list)
  22. )
<a href="http:/http://axprogramlisp.blogspot.pe" class="bbc_link" target="_blank">By Alexander Castro</a>

Lee Mac

  • Seagull
  • Posts: 12915
  • London, England
Re: List Layers Freezer
« Reply #1 on: September 23, 2016, 01:31:45 PM »
Code - Auto/Visual Lisp: [Select]
  1. (defun lislayerdoc ( / d l r )
  2.     (while (setq d (tblnext "layer" (not d)))
  3.         (if (and (zerop (logand 21 (cdr (assoc 70 d))))
  4.                  (< 0 (cdr (assoc 62 d)))
  5.                  (/= "defpoints" (strcase (setq l (cdr (assoc 2 d))) t))
  6.             )
  7.             (setq r (cons l r))
  8.         )
  9.     )
  10.     (vl-sort r '<)
  11. )

amc.dicsac

  • Newt
  • Posts: 109
  • Autocad 2008
Re: List Layers Freezer
« Reply #2 on: September 23, 2016, 01:46:03 PM »
Hi Lee  :yay!: :yay!: :yay!:

Thanks.
<a href="http:/http://axprogramlisp.blogspot.pe" class="bbc_link" target="_blank">By Alexander Castro</a>

Lee Mac

  • Seagull
  • Posts: 12915
  • London, England
Re: List Layers Freezer
« Reply #3 on: September 23, 2016, 01:49:31 PM »
You're welcome.  :-)