@pbejse i wish to use shorter like you said but, block is literally to many, and some times got block inside block.
@Kent1Cooper i hope you dont mind, coz i am using others program from autocad, but it is almost the same, in autocad, it will have command explode and burst. i use burst mostly before changing to current application to avoid the information lost. my target is only block. i found other lisp routine but it use explode.
in early routine i have this code:
(defun C:Test (/ sset)
(setq brf (ssget "_X" '((0 . "INSERT"))))
(while (/= count 0)
(setq count (sslength brf))
(command "move" brf "" "d" "0,0,0")
(command "select" "p" "" "pburst" "p" "")
)
(princ)
)
so this code function, but it do infinite bursting due to no stopping function.
i work on other, like @pbejse say, use repeat but i got other issue say no function definition.
i make the routine goes 3 time running. if it giving the same number block remaning, it will stop, if not, it will run again. here are the code. some times, block were set to unexplodable so that make my first routine do the infinite burst.
(defun C:test (/ sset)
(defun C:brfabc ()
(setq brfa (ssget "_X" '((0 . "INSERT"))))
(setq counta (sslength brfa))
(command "pburst" brfa "")
(setq brfb (ssget "_X" '((0 . "INSERT"))))
(setq countb (sslength brfb))
(command "pburst" brfb "")
(setq brfc (ssget "_X" '((0 . "INSERT"))))
(setq counta (sslength brfc))
(command "pburst" brfc "")
(princ)
)
(c:brfabc)
(if (= counta countb countc)(prompt "\ndone")
(t c:brfabc)
)
(princ)
)
i just put done in the end for now. i wish to extend the routine in future. you can change the "pburst" to "explode" or "burst". for move function, i just to make sure that it selecting the visible block only, but it does not work. i thought if putting like that it will ignore block on the freeze and thawn layer.
anyway what am i missing on the routine?
{error : no function definition <T> ; expected FUNCTION at [eval]} i got this.