Author Topic: Create complex layer property filter?  (Read 1605 times)

0 Members and 1 Guest are viewing this topic.

CHulse

  • Swamp Rat
  • Posts: 504
Create complex layer property filter?
« on: October 29, 2015, 04:21:54 PM »
Folks,
I've come across several examples of lisps to create layer filters, but I have never seen one with more than one line of conditions.
I've played with this for a while but can't seem to figure out how to create multiple lines, like the attached example.

Here is what I am working with to create a single line (not my work, found the original here: https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-layer-filter-lisp/td-p/1563704)

Code: [Select]
(progn
      (setq XdLst (list (cons 0 "XRECORD")
                        (cons 100 "AcDbXrecord")))
      (setq XrecData (append XdLst
                             (list (cons 1 NAME)
                                   (cons 1 FILTER)
                                   (cons 1 "*")
                                   (cons 1 "*")
                                   (cons 70 0)
                                   (cons 1 "*")
                                   (cons 1 "*"))))
      (setq NewXRec (entmakex XRecData))
      (dictadd NewDict Name NewXRec)
    )

I'm at a loss on this, so any direction would be greatly appreciated.

Thx
Cary Hulse
Urban Forestry Manager
Wetland Studies and Solutions

Civil 3D 2020 & 2023

ronjonp

  • Needs a day job
  • Posts: 7524
Re: Create complex layer property filter?
« Reply #1 on: October 29, 2015, 05:10:31 PM »
Under your (cons 1 FILTER) .. separate your layer names with commas like so: (cons 1 "test1,test2,test3")

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

CHulse

  • Swamp Rat
  • Posts: 504
Re: Create complex layer property filter?
« Reply #2 on: October 30, 2015, 07:16:03 AM »
Awesome, thanks
Cary Hulse
Urban Forestry Manager
Wetland Studies and Solutions

Civil 3D 2020 & 2023

ronjonp

  • Needs a day job
  • Posts: 7524
Re: Create complex layer property filter?
« Reply #3 on: October 30, 2015, 08:52:30 AM »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC