First off, I have this:
(setq *acad (vlax-get-acad-object)
doc (vla-get-activedocument *acad)
layers (vla-get-layers doc)
alist (list "a-panel" "a-furn")
)
Then I create a list of layernames like so:
(vlax-for i layers
(if (or (wcmatch (strcase (vla-get-name i) t) "rcp-*")
(= (strcase (vla-get-name i) t) "a-head")
)
(setq rcplist (append rcplist (list i)))
(setq layernames (append layernames (list (vla-get-name i))))
)
)
This allows me to have one list for freezing and while the other thaws the layers.
What I'm having trouble with is how the next piece handles putting the list together.
(foreach i alist
(foreach j layernames
(if (= i (strcase j t))
(setq below
(append below (list (vla-item layers j)))
)
)
)
)
What I'm thinking this should do is take one item from alist (i), compare it with all the items in layernames (j) and if it finds a match append it to list "below". What's it's doing is checking (i) twice. Why?