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.
(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.
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.
(command "_.-attedit" "_Y" "*" "*" "*" pause "" "_C" "ByLayer" "_N")
And this works for a single window selection:
(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