I'd like to get the list of blocks from a external file (either txt or xls) as apposed to here. Ideally each block name would be in its own row/line. Any example code how to best pull a list like this "x48,y48,v48,x60,y60,v60"?
(setq ss (ssget "x" '((0 . "INSERT") (2 . "x48,y48,v48,x60,y60,v60"))))
Thanks
Solved! Go to Solution.
Solved by hmsilva. Go to Solution.
Something like this perhaps.
(if (setq fn (getfiled "Select a txt file" (getvar 'DWGPREFIX) "txt" 0)) (progn (setq of (open fn "r")) (while (setq b (read-line of)) (if (/= " " b) (if (not a) (setq a b) (setq a (strcat a "," b)) ) ) ) (close of) (setq ss (ssget "x" (list '(0 . "INSERT") (cons 2 a)))) ) )
HTH
Henrique
Yes, just like that. I like the getfiled, but changed it to findfile with a hard coded path. Performs the task just as I wanted it to. Thanks a bunch for the quick soultion!