Tharwat, I don't think that will work. You want to select entities that may have the color changed or have their layer color set to the desired value.
Manuel, you need to cycle through the layer list and create a list of layers with your desired color. You could do this with a while statement.
Code:
(defun LayerListByColor (ColorNumber / LayerData LayerList)
(setq LayerList '())
(while (setq LayerData (tblnext "LAYER" (not LayerData)))
(if (= (cdr (assoc 62 LayerData)) ColorNumber)
(setq
LayerList (append LayerList (list (cdr (assoc 2 LayerData))))
)
)
)
(if (> (length LayerList) 0)
LayerList
)
)
Once this list is generated, use the layer names and CONStruct an associative list. You can quickly do this with the MAPCAR and LAMBDA functions.
Code:
(mapcar '(lambda (x) (cons 8 x)) (layerlistbycolor 1))
From there you need to add a filter for color and wrap the entire filter with an set of "XOR" filters
Code:
(setq filter (list (cons -4 "<XOR")(cons 62 1)(mapcar '(lambda (x) (cons 8 x)) (layerlistbycolor 1))(cons -4 "XOR>")))
You could then add this to your SSGET function.