Thanks for the suggestions. Closer, but I'm not quite there yet.
CAB's code works, but I haven't managed to convert it to an automatic routine. I need something that does not require any manual selections. A description of what I'm working on is at the bottom of this post.
Lee's code is perfect for a hard-coded value for color, but I need to iterate through all the colors. If I change
(ssget "_X" '((62 . 1) (8 . "power") (-4 . "<NOT") (-4 . "*") (420 . 0) (-4 . "NOT>")))
to
(ssget "_X" '((62 . COUNTER) (CONS 8 layer_name) (-4 . "<NOT") (-4 . "*") (420 . 0) (-4 . "NOT>")))
Bricscad reports error : bad argument type <(62 . COUNTER)> ; expected <INTEGER> at [DXF/XED DATA] Autocad is not as helpful in its error message. This is with a (setq counter 1) just before.
With
(ssget "_X" '((CONS 62 COUNTER) (CONS 8 layer_name) (-4 . "<NOT") (-4 . "*") (420 . 0) (-4 . "NOT>")))
the color is ignored and I get all entities.
I'm playing with a routine to simulate locked layer fading in Bricscad. The concept is to copy all entities on the layer-to-fade to a new temporary layer, take the blocks on the temporary layer to linework, then reset entity colors on the temporary layer to RGB colors that are 60% of the original RGB values. The original layer is then locked, frozen, and turned off and the temporary layer is locked. Each faded layer has a separate temporary layer so that unfading a layer just requires deleting the temporary layer then restoring the original layer. I have a version that works fairly well but that creates the temporary entities from blocks by exploding vla objects. It does not handle all entities as well as I'd like. I had the idea that it would be a lot easier to do a process using COPYBASE to get entities to the temporary layer, then iBurst (Lee's program slightly modified to accept a passed-in layer name) to take the blocks to linework, then handle the color changes on the temporary layer by getting a selection set for each entity color and changing the colors of the selection set with CHPROP. The problem I'm running in to is that when I assign an RGB color to an entity by assigning a dxf 420 code entry the normal color code (dxf 62) is automatically changed to a color visually close to the RGB color. For example red entities are changed to color 14 in dxf code 62. If I'm looping for color 1 to color 255 that means red entities get changed to 14 on the first step of the loop, and when the loop reaches color 14 those entities get dimmed a second time. Starting the loop at color 255 and going down to 1 changes which entities get dimmed more than once but doesn't eliminate the problem. My idea was to eliminate entities that already have a dxf 420 code when I get a selection set for a particular entity color, but I have not been successful so far in getting both the layer and the current color passed in to a filter as variables. My though is that having ssget do the filtering will be faster than having a post-filter. I could always do hard coded calls for each of the colors. That worked for Microsoft in early versions of Word, but it doesn't seem like good practice.