Message 1 of 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have the following function that's a work in progress...
It is supposed to loop through a drawing and gather all "INSERT" type objects. If the TYPE is a an Electrical Symbol, it moves on - if the object is NOT a symbol it explodes the block. The loop repeats for nested blocks and symbols.
Ultimately I want the code to explode all blocks (including nested blocks) but leave all electrical symbols alone. What am i doing wrong?
(defun m:explodeAllButSymbols (/ a ) (setvar "qaflags" 1) ;Get the list of blocks in the drawing (setq a (ssget "X" (list (cons 0 "INSERT")))) ;while the list is not null (while (/= a nil)
(progn ;if the object type is NOT "SYM" or a Symbol then explode it if (!= (type a) "SYM" (command "_.explode" a "") )
;next (setq a (ssget "X" (list (cons 0 "INSERT"))))
);end progn );end while
(setvar "qaflags" 0) (princ)
);end
Solved! Go to Solution.