Author Topic: Attedit Lsp?  (Read 3171 times)

0 Members and 1 Guest are viewing this topic.

CECE_CAD

  • Guest
Attedit Lsp?
« on: July 30, 2007, 05:28:40 PM »
Ok, I just did –attdef  to oh 100 room names,  the colors in the properties were  set to white!  I needed them to be set to bylayer. 

So, is there a way to put a lisp together for this?   I was thinking something like this would work, but if it did I wasn’t sure if it would continue.

(defun C:aqa ()
 (vl-cmdf "_attedit" "y" "*" "*" "*" (ssget) "c" "bylayer" "N"))

After you select your attributes it doesn’t recognize the rest of the commands?  I’m assuming this is not the correct way to put it together.  Does anyone, that is smarter at putting commands like this together have a better idea?

2008CAD

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Attedit Lsp?
« Reply #1 on: July 30, 2007, 05:41:44 PM »
It doesn't look like you can use ssget within the command.  I would assume because it doesn't select nested objects.  It looks like the only way is to put a pause in there when you want to select the objects.  This will only let you select once though.
Code: [Select]
(vl-cmdf "_.-attedit" "_Y" "*" "*" "*" pause "_C" "ByLayer" "_N")
But this doesn't work either.  It doesn't see the pause, and tries to pass the "_C" as saying you want to use a crossing selection.  I don't know what this doesn't work.  But you could create your own routine to select blocks with attributes, and then change the attributes to ByLayer if you want.

Maybe someone will come along and enlighten us with why the command doesn't work the way we think it should.

Sorry, not much help I guess.   :oops:
Tim

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

Please think about donating if this post helped you.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Attedit Lsp?
« Reply #2 on: July 30, 2007, 06:08:37 PM »
Are they still attributes or have you put them inside of blocks?
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: Attedit Lsp?
« Reply #3 on: July 30, 2007, 06:12:24 PM »
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: Attedit Lsp?
« Reply #4 on: July 30, 2007, 06:14:31 PM »
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: Attedit Lsp?
« Reply #5 on: July 30, 2007, 06:53:57 PM »
Since you are in the exclusive club of 2008 you have the option of the new core command "setbylayer".
Isolate the room tags and then window select to your hearts content
« Last Edit: July 30, 2007, 06:55:45 PM by Krushert »
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

CECE_CAD

  • Guest
Re: Attedit Lsp?
« Reply #6 on: July 31, 2007, 07:05:56 AM »
That is too kewl!  :ugly: That is what I'm talking about, worked great!  Thanks! And Cab yes they are defined blocks.


Since you are in the exclusive club of 2008 you have the option of the new core command "setbylayer".
Isolate the room tags and then window select to your hearts content
« Last Edit: July 31, 2007, 07:25:43 AM by CECE_CAD »

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Attedit Lsp?
« Reply #7 on: July 31, 2007, 08:29:51 AM »
It doesn't look like you can use ssget within the command.  I would assume because it doesn't select nested objects.  It looks like the only way is to put a pause in there when you want to select the objects.  This will only let you select once though.
Code: [Select]
(vl-cmdf "_.-attedit" "_Y" "*" "*" "*" pause "_C" "ByLayer" "_N")
But this doesn't work either.  It doesn't see the pause, and tries to pass the "_C" as saying you want to use a crossing selection.  I don't know what this doesn't work.  But you could create your own routine to select blocks with attributes, and then change the attributes to ByLayer if you want.

Maybe someone will come along and enlighten us with why the command doesn't work the way we think it should.

Sorry, not much help I guess.   :oops:

Tim,
The vl-cmdf complains where command doesn't in this particular command.
As you know the vl_cmdf processes the arguments differently from command.
Not sure exactly why it doesn't work in this case.
But this version does work for one entity selection.
Code: [Select]
(command "_.-attedit" "_Y" "*" "*" "*" pause "" "_C" "ByLayer" "_N")
And this works for a single window selection:
Code: [Select]
(command "_.-attedit" "_Y" "*" "*" "*" pause pause "" "_C" "ByLayer" "_N")
Appears that attedit uses a special version of ssget in that you can select like nentsel but with
a crossing window. You could have a subroutine with nentsel the only returned attributes.

Or maybe a simulation of the hybrid ssget that attedit uses.

Pseudo code
Get rectangle from the user for coordinates
Use ssget with block with attributes filter
Maybe highlight the attributes?
Return the attributes upon Enter
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.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Attedit Lsp?
« Reply #8 on: July 31, 2007, 11:05:19 AM »
Thanks Alan for the heads up.  I don't use that command at all, and when I tried the 'command' way it didn't work either, but then again I was trying a selection set style with only one pause.

The OP got what they wanted, and I learned something new.  Time to go home!  :lmao:
Tim

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

Please think about donating if this post helped you.