So the last piece I'm having trouble with is here:
Code:
(foreach lay laylist2
(vl-load-com)
(setq activedocument (vla-get-activedocument (vlax-get-Acad-Object)))
(setq theblocks (vla-get-blocks activedocument)) ;this needs to be: get-block on current layer/"lay" X)faulty
(setq xrlist '())
(vlax-for item theblocks
(setq yesxref (vlax-get-property item 'isXref))
(if (= yesxref :vlax-true)
(progn
(setq ablock (vlax-get-property item 'Name))
(setq xrlist (append (list ablock) xrlist)) ;establish xrlist - list of xrefs on layers belonging to laylist2
);progn
);if
);vlax-for
);foreach
At the moment it's getting all blocks in the whole active document, but I want it to be getting only the blocks on each "lay"(layers in laylist2)..
And then if those are xrefs, add them to the list: xrlist.
So something like this??
Code:
(setq activedocument (vla-get-activedocument lay (vlax-get-Acad-Object)))
(setq theblocks (vla-get-blocks activedocument))