Author Topic: Search through layers ...  (Read 2574 times)

0 Members and 1 Guest are viewing this topic.

Hangman

  • Swamp Rat
  • Posts: 566
Search through layers ...
« on: January 16, 2007, 05:11:49 PM »
Hey guys,
Is there a way to write a piece of code (probably a book of code knowing my luck) that will search through layer names, pick out certain layers with a particular word in it and then select the items on those layers ??

To give you a little background;  I have this very messy drawing that I will be working with for the next three years.  As the Architects draftsmen do thier little updates in Microstation, they will send the updated set of plans to me and I get to decipher what is going on.
So I receive these drawings and there are no less than twelve (12) layers, each named differently, dealing with gridlines.  They are each different because of the different sections of the huge complex we are designing over the next three years.

Each of the 12 layers for the gridlines all have different linetypes, different colors, & different names.
Each of these 12 layers are named differently with the exception of one common thing.  They each have the word GRID in the layers name.

So I was wondering if it would be possible to search through each of the layers in the drawing, find the word GRID and select the items on just those layers with the word GRID in it to isolate.
Hangman  8)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Drafting Board, Mechanical Arm, KOH-I-NOOR 0.7mm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Search through layers ...
« Reply #1 on: January 16, 2007, 05:15:28 PM »
Yes it can be done, and it isn't to hard.  I will let you do this one by yourself, with help when needed.  The first hints are 'tblsearch' and 'wcmatch'.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Hangman

  • Swamp Rat
  • Posts: 566
Re: Search through layers ...
« Reply #2 on: January 16, 2007, 06:09:43 PM »
Oky Doky Smokey.
WCMATCH, I've run into that once before, but couldn't remember what it was called or what it does.

K, so I'll report back and let you know what I've come up with.  It might be awhile though, between School, Work, the Wife, and the ... Wailing banshee's, I don't get very far very fast.

Thanks Tim.
Hangman  8)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Drafting Board, Mechanical Arm, KOH-I-NOOR 0.7mm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Search through layers ...
« Reply #3 on: January 16, 2007, 06:11:53 PM »
I can wait almost as long as you can.  I just want to push you instead of us giving you full working code.   :angel: It looks like you want to learn, and this will kind of force you.  :evil:
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Jeff_M

  • King Gator
  • Posts: 4099
  • C3D user & customizer
Re: Search through layers ...
« Reply #4 on: January 16, 2007, 06:15:58 PM »
Of course, if you want ALL the objects on just those layers all at once, a filtered selection set with wildcards is all you need.......

Hangman

  • Swamp Rat
  • Posts: 566
Re: Search through layers ...
« Reply #5 on: January 16, 2007, 06:18:29 PM »
I can wait almost as long as you can.  I just want to push you instead of us giving you full working code.   :angel: It looks like you want to learn, and this will kind of force you.  :evil:

Oohhhh, ...  I hate being pushed.  :realmad:
gimme, gimme, gimme, ... I need, I need, I need, ...  (Bill Murray - What About Bob?)   :-D


Of course, if you want ALL the objects on just those layers all at once, a filtered selection set with wildcards is all you need.......

Give me an example, what do you mean a "filtered selection set with wildcards ..." ??
Hangman  8)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Drafting Board, Mechanical Arm, KOH-I-NOOR 0.7mm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Search through layers ...
« Reply #6 on: January 16, 2007, 07:06:18 PM »
Hint:

(ssget)

:)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Jeff_M

  • King Gator
  • Posts: 4099
  • C3D user & customizer
Re: Search through layers ...
« Reply #7 on: January 16, 2007, 07:10:58 PM »
Hint #2
Code: [Select]
'((8 . "*GRID*"))
Read the Developer help for Filtered Selection Sets....also look into the argument for selecting all objects.

Hangman

  • Swamp Rat
  • Posts: 566
Re: Search through layers ...
« Reply #8 on: January 16, 2007, 07:45:20 PM »
Ohh man you guys make this difficult.   ^-^

I can understand the books, to a point.  I learn well by example because I am struggling with how the code is put together.  When I see a bunch of code put together and working, I can go search out each element of the code.  It helps to see it in context.
That's been my biggest struggle with VLA.  I read all the help files on each one, but I can't figure out how to put it together to make it work properly.  I've tried a couple of different routines with VLA and finally after hours of frustration, I went back to lisp to make it work.  I just need to find some similar examples so I can get the code put together properly.

Anyways, K, so Hint 1 and Hint 2.   I'm going to take this challenge.  But, right now, I've got a boat-load of homework to do.

Thanks guys, I appreciate your help.

Hangman  8)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Drafting Board, Mechanical Arm, KOH-I-NOOR 0.7mm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

VVA

  • Newt
  • Posts: 166
Re: Search through layers ...
« Reply #9 on: January 17, 2007, 01:45:38 AM »