Hint: You can iterate through the layer collection once by placing both of your conditions in one vlax-for statement.
Also, look at replacing if/progn with and.
As for combining your foreach statements, why not use a mapcar statement?
I can't thank you enough for the method you use in helping me. (I come here looking for hints and techniques, not quick easy answers) but sometimes seeing my failed code written correctly after hours of playing with it really helps.
I nailed the (vlax-for) (and) (and)... but not without your hit in your second post
I failed at getting the mapcar to work... I couldn't figure out the lambda function by the example in help, with what I was trying to do,,, (I couldn't connect the dots)
Here is my failed attempt just to show I was getting close
Anytime cadman..i like trying it before being given the answer as well.
I'm passing the lists to mapcar there.
Here's a small example with the mapcar statement.
I tell you, I don't think I would have solved the mapcar lambda on my own...
I am looking at and still don't understand it... I will need to study this...