TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: CADwiesel on March 06, 2015, 08:31:11 AM

Title: Nestet Layerfilter
Post by: CADwiesel on March 06, 2015, 08:31:11 AM
Hi there,

i'm trying to read all the Layerfilters or Layergroupfilters with the attached Layernames
Code - Auto/Visual Lisp: [Select]
  1. (defun LAYGROUPFILTER( / OBJ DICT ITEM E D N LayerITEMS Layerobj Layernams Result)
  2.       (=(vla-get-hasextensiondictionary OBJ):vlax-true)
  3.       (setq OBJ(vla-GetExtensionDictionary OBJ))
  4.             (setq DICT(vl-catch-all-apply 'vla-item (list OBJ "AcLyDictionary")))
  5.           )
  6.       )
  7.   )
  8.   (vlax-for ITEM DICT
  9.     (if(and(setq E(vlax-vla-object->ename ITEM))
  10.           (setq D(entget E))
  11.           (=(type(cdr(assoc 1 D)))'STR)
  12.           (=(strcase(cdr(assoc 1 D)))"ACLYLAYERGROUP")
  13.           (=(type(setq N(cdr(assoc 300 D))))'STR)
  14.       )
  15.       (progn
  16.         (setq LayerITEMS(member(assoc 1 D)D))
  17.       (while (setq Layerobj(assoc 330 LayerITEMS))
  18.         (setq Layernams(cons (cdr(assoc 2(entget(cdr  Layerobj))))Layernams))
  19.         (setq LayerITEMS(vl-remove Layerobj LayerITEMS))
  20.         )
  21.         (setq Result(cons(cons n (list (vl-remove 'nil Layernams)))Result))
  22.       )
  23.     )
  24.   )
  25. )
  26. Result
  27. )

to get the Filters if they are normaly created ist'n not as heavy, but if they are nested, i've not really an Idea to get them.
Remark. I dont won't to delete them, only read and list.

Maybe somebody can show me the right step?

Regards Martin