Author Topic: List of Layerstates  (Read 1336 times)

0 Members and 1 Guest are viewing this topic.

MatGrebe

  • Mosquito
  • Posts: 16
List of Layerstates
« on: November 24, 2023, 07:13:15 AM »
Hi all,
i've found a lisp, that gives me a list of layerstates to fill a dcl-dialogbox with. I would like to exclude the layerstates of xrefs from th list. How can i determine a certain layerstate is from the drawing or an xref ?
Thanks
Mathias

;; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/retrieve-list-of-layer-states-name-in-2002/td-p/850746
(defun get_lslist ( / nme lslist)
   (vlax-for x
      (vla-item
         (vla-GetExtensionDictionary
            (vla-get-layers
               (vlax-get-property (vlax-get-acad-object) 'activedocument)
            )
         )
         "ACAD_LAYERSTATES"
      )
      (setq nme (vlax-get x 'name))
      (setq lsList (cons nme lsList))
   )
   (reverse lsList)
)