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]
(
defun
LAYGROUPFILTER
(
/
OBJ DICT ITEM E D N LayerITEMS Layerobj Layernams Result
)
(
if
(
and
(
setq
OBJ
(
vla-get-layers
(
vla-get-activedocument
(
vlax-get-acad-object
)
)
)
)
(
=
(
vla-get-hasextensiondictionary
OBJ
)
:vlax-true
)
(
setq
OBJ
(
vla-GetExtensionDictionary
OBJ
)
)
(
not
(
vl-catch-all-error-p
(
setq
DICT
(
vl
-
catch
-
all
-
apply
'
vla-item
(
list
OBJ
"AcLyDictionary"
)
)
)
)
)
)
(
vlax-for
ITEM DICT
(
if
(
and
(
setq
E
(
vlax
-
vla
-
object
->
ename ITEM
)
)
(
setq
D
(
entget
E
)
)
(
=
(
type
(
cdr
(
assoc
1
D
)
)
)
'STR
)
(
=
(
strcase
(
cdr
(
assoc
1
D
)
)
)
"ACLYLAYERGROUP"
)
(
=
(
type
(
setq
N
(
cdr
(
assoc
300
D
)
)
)
)
'STR
)
)
(
progn
(
setq
LayerITEMS
(
member
(
assoc
1
D
)
D
)
)
(
while
(
setq
Layerobj
(
assoc
330
LayerITEMS
)
)
(
setq
Layernams
(
cons
(
cdr
(
assoc
2
(
entget
(
cdr
Layerobj
)
)
)
)
Layernams
)
)
(
setq
LayerITEMS
(
vl-remove
Layerobj LayerITEMS
)
)
)
(
setq
Result
(
cons
(
cons
n
(
list
(
vl-remove
'
nil
Layernams
)
)
)
Result
)
)
)
)
)
)
Result
)
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