Author Topic: layers on/off by layerfilter or layer list from layer filter  (Read 238 times)

0 Members and 1 Guest are viewing this topic.

DraxJDM

  • Newt
  • Posts: 48
Hey all,

looking for away to set layers on/off/freeze/thaw  bij filter name.
After alot of searching, i have noluck :-(

the next thing is, try to find the layers that are in a layer filter.

At this moment i'm stuck at the point that ik have the filter names, but no layers.
I have tried to look in to de dxf code's, i just can't find it.

The reason i need this is,  to run a lot of drawings.
And i need the layers on/off by filtername.

thx for the help, John

Code: [Select]
(defun :LayerFilterList (/ :SubFilterList)

  (defun :SubFilterList (dict / ent lst)
    (foreach ent (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 350)) dict))
      (setq lst (append lst
                        (cons ent (if (assoc 360 (entget ent))
                                    (:SubFilterList (entget (cdr (assoc 360 (entget (cdr (assoc 360 (entget ent)))))))))))))
    lst)

  (mapcar '(lambda (x) (cdr (assoc 300 (entget x))))
          (:SubFilterList (dictsearch
                            (vlax-vla-object->ename
                              (vla-getextensiondictionary
                                (vla-get-layers
                                  (vla-get-activedocument
                                    (vlax-get-acad-object)))))
                            "ACLYDICTIONARY"))))


(:LayerFilterList)