Author Topic: Layer filter wildcards  (Read 5178 times)

0 Members and 1 Guest are viewing this topic.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Layer filter wildcards
« Reply #15 on: December 23, 2008, 12:48:24 PM »
Krushert,

Me again. From the coding examples, I'm able to create "~M*".
But not the second  line "*|*". Do you know how?

Code: [Select]
(defun c:EagerToLearnCAD ( / xdict dict xrecname )

    (setq xdict
        (vlax-vla-object->ename
            (vla-getextensiondictionary
                (vla-get-layers
                    (vla-get-activedocument (vlax-get-acad-object))
                )
            )
        )   
    )
   
    (setq dict
        (if (setq dict (dictsearch xdict "ACAD_LAYERFILTERS"))
            (cdr (assoc -1 dict))
            (dictadd xdict "ACAD_LAYERFILTERS"
                (entmakex
                   '(
                        (0 . "dictionary")
                        (100 . "AcDbDictionary")
                        (280 . 0)
                        (281 . 1)
                    )
                )
            )
        )
    )
   
    (princ
        (if (dictsearch dict (setq xrecname "EagerToLearnCAD"))
            (strcat
                "Layer filter named <"
                xrecname
                "> already exists."
            )
            (if
                (dictadd dict xrecname
                    (entmakex
                        (append
                           '(
                                (0 . "xrecord")
                                (100 . "AcDbXrecord")
                                (280 . 1)
                            )   
                            (list (cons 1 xrecname))
                           '(
                                (1 . "~M*,*|*")
                                (1 . "*")
                                (1 . "*")
                                (70 . 0)
                                (1 . "*")
                                (1 . "*")
                                (-3         
                                    (
                                        "ACAD"
                                        (1000 . "( NAME== \"~M*\" or NAME== \"*|*\" )")
                                    )
                                )
                            )   
                        )
                    )
                )
                (strcat
                    "Created layer filter named <"
                    xrecname
                    ">."
                )
                "Doh! Something horrible happened: Call mommy."
            )   
        )   
    )   
   
    (princ)
   
)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

EagerToLearnCad

  • Guest
Re: Layer filter wildcards
« Reply #16 on: December 23, 2008, 01:16:04 PM »
Thanks guys!

MP,

One last. Do you know how to check/select the "Invert Filter" checkbox with lisp? I would
like to be able to toggle it (check/unchecked) in my small program.

mkweaver

  • Bull Frog
  • Posts: 352
Re: Layer filter wildcards
« Reply #17 on: January 02, 2009, 02:18:03 PM »
Thanks guys!

MP,

One last. Do you know how to check/select the "Invert Filter" checkbox with lisp? I would
like to be able to toggle it (check/unchecked) in my small program.

When you figure out the toggle code, have it email you a penny each time its run, then post the code.  You'll be able to retire!

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Layer filter wildcards
« Reply #18 on: January 02, 2009, 02:24:47 PM »
I'm likely wrong but I don't believe it's available to lispers. I've scanned the system variables, environment variables, atoms family, the registry, ini files ad infinitum, no can find. :(
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

EagerToLearnCad

  • Guest
Re: Layer filter wildcards
« Reply #19 on: January 02, 2009, 08:17:50 PM »
MP,

Thanks for checking.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Layer filter wildcards
« Reply #20 on: January 03, 2009, 11:50:37 AM »
You're most welcome ETLC.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Layer filter wildcards
« Reply #21 on: January 03, 2009, 09:42:16 PM »
couldn't you use the NOT?

Code: [Select]
(ssget '((-4 . "<not")(8 . "*|*")(-4 . "not>"))))
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox