Author Topic: Layer filter wildcards  (Read 5242 times)

0 Members and 1 Guest are viewing this topic.

EagerToLearnCad

  • Guest
Layer filter wildcards
« on: December 22, 2008, 01:39:46 PM »
Hi,

For layer filters, if I just want the main layers names (excluding xref layer name)
in a drawing I use the wilcard "~*|*".

What woud the wildcard be if I want only layers that begin with letter "M"
(m for mechanical) & excluding all xref layers?....Thanks in advance.

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: Layer filter wildcards
« Reply #1 on: December 22, 2008, 01:55:23 PM »
Interesting
Let me go look up something of Mark's
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: Layer filter wildcards
« Reply #2 on: December 22, 2008, 02:26:45 PM »
This is interesting.  looks like you an only filter for either or the first time.  It seems you can not filter a already filter list. 

Somebody a lot smarter that me might think of a way around this.

In the meantime, you might want to take a look at Mark's Using wildcards to find things.  Very helpful for me so far.  until now
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Layer filter wildcards
« Reply #3 on: December 23, 2008, 06:59:02 AM »
I think this is the filter you want
[M][~*|*]*
Anything starting with 'M' followed by anything except containing '|'
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Layer filter wildcards
« Reply #4 on: December 23, 2008, 07:43:21 AM »
well that doesn't work but this will.
Code: [Select]
(setq ss (ssget '((8 . "M*") (8 . "~*|*"))))
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

EagerToLearnCad

  • Guest
Re: Layer filter wildcards
« Reply #5 on: December 23, 2008, 08:38:43 AM »
Cab,

It did'nt work. Thank you for trying.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Layer filter wildcards
« Reply #6 on: December 23, 2008, 09:52:19 AM »
That should work to create a selection set.
What exactly are you trying to do with the layer names?
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: Layer filter wildcards
« Reply #7 on: December 23, 2008, 10:01:12 AM »
Here is is a routine from MP that I use a lot to create the filter out xrefs layers. 
It is worth sharing both from it value in what it does and the hope of you might be able to mine something from the code.
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Layer filter wildcards
« Reply #8 on: December 23, 2008, 10:15:22 AM »
Hi,

For layer filters, if I just want the main layers names (excluding xref layer name)
in a drawing I use the wilcard "~*|*".

What woud the wildcard be if I want only layers that begin with letter "M"
(m for mechanical) & excluding all xref layers?....Thanks in advance.

If you're trying to create a layer filter AND you're not interested in doing it thru code one way you could achieve the above is to use a filter that matches the opposite of what you want and invert it. I don't have a lot of experience creating them manually but I believe you need to create 2 entries for the filter above, one would be ~M* and the other would be *|*.

Inverted it yields "All layers that start with M that are not xref based".

Edit: Added piccy:

       
« Last Edit: December 23, 2008, 10:30:36 AM by MP »
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: Layer filter wildcards
« Reply #9 on: December 23, 2008, 10:34:04 AM »
Sweeeeeettttt  :-)
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

EagerToLearnCad

  • Guest
Re: Layer filter wildcards
« Reply #10 on: December 23, 2008, 11:22:29 AM »
MP,

Thank you!..By the way, What did you mean  "Edit: Added piccy:"?


Krushert,
Thank you too!..You saved me time. This was the next thing I was going
to research.

Happy Holidays Everyone!!!


Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: Layer filter wildcards
« Reply #11 on: December 23, 2008, 11:25:04 AM »
MP,

Thank you!..By the way, What did you mean  "Edit: Added piccy:"?


Krushert,
Thank you too!..You saved me time. This was the next thing I was going
to research.

Happy Holidays Everyone!!!



No problem and Welcome to The Swamp

MP had come back and added the image of the screen shot
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

EagerToLearnCad

  • Guest
Re: Layer filter wildcards
« Reply #12 on: December 23, 2008, 12:21:24 PM »
Krushert,

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

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Layer filter wildcards
« Reply #13 on: December 23, 2008, 12:38:17 PM »
Krushert,

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


Separate the filters with a comma. (1 . "m*,*|*")

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Layer filter wildcards
« Reply #14 on: December 23, 2008, 12:47:12 PM »
Note the the comma is an implied OR.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.