I know that (setq ss (ssget "X" (list (cons 0 "INSERT")(cons 66 1)))) gets a ss of all blocks that contain attributes, what i'm wanting to do is get the block names into a list (MYLIST)to use with the "foreach" function.
Can anyone help? thanks
|
I know that (setq ss (ssget "X" (list (cons 0 "INSERT")(cons 66 1)))) gets a ss of all blocks that contain attributes, what i'm wanting to do is get the block names into a list (MYLIST)to use with the "foreach" function.
Can anyone help? thanks
Hi,
Try this
Code:((lambda ( / ss n namblk lst_namblk) (setq ss (ssget "X" (list (cons 0 "INSERT")(cons 66 1)))) (cond (ss (setq n (sslength ss)) (repeat n (setq namblk (cdr (assoc 2 (entget (ssname ss (setq n (1- n))))))) (if (not (member namblk lst_namblk)) (setq lst_namblk (cons namblk lst_namblk)) ) ) lst_namblk ) ) ))