I am trying to create a routine that will search through all layers in a drawing and assign a lineweight to each layer based on color. I haven't yet defined a function in the attached sample, but I can get it to change some layer information. Strangely, it changes only every other layer. I am wondering if that is because of the while statement and the relative position of the (setq flag nil) list. I did try moving it inside the loop, but the results were the same.
Any help is greatly appreciated.
Thanks,