TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: daron on March 14, 2008, 12:41:55 PM
-
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?
-
Well, that's strange. I just rewrote that part from the inside out and it worked just fine. Uh??? Nevermind, I guess.
-
Then again, maybe not.
-
Well, since I'm having a conversation with myself, I'll just answer. It's works as it should. There was a variable that apparently had double information that was causing the problem.
-
Glad ya'll figured it out. 8-)
-
Thanks, from all of us.