- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've been using the lisp below with succes on my old PC, but somehow it doesn't react the same way on my new PC.
(defun c:BAB (/) (c:BrstAllBlocks))
(defun c:BrstAllBlocks (/ sstBlocks)
(setvar "cmdecho" 0)
;;; START REMOVE BLOCKS
(setq sstBlocks (ssget "X" '((0 . "INSERT"))))
(if (= sstBlocks nil)
(princ "\nNo blocks present in this drawing"))
(while (and (/= sstBlocks nil) (> (sslength sstBlocks) 0))
(princ (strcat "\nNumber of blocks to burst: "
(itoa (sslength sstBlocks))))
(sssetfirst nil sstBlocks)
(c:burst)
(setq sstBlocks nil)
(setq sstBlocks (ssget "X" '((0 . "INSERT"))))
)
;;; END REMOVE BLOCKS
(Defun C:ByToCol()
(vl-vbarun "P:\\DATA\\ACAD\\Common Files\\Lisp\\by2col.dvb!Module1.ColorToEntity")
)
(setvar "cmdecho" 1)
(princ)
)
After the burst command it now asks me to select the objects to burst for the second time, as you can see in the log below: Command: bab Number of blocks to burst: 2 Initializing...0 found Select objects: I've exported the profile of the old computer and imported it on the new one to be sure every setting is the same. I even copied the old shortcut to the new computer to be sure Autocad Mechanical is started with the same profile. Although it worked on my old computer somehow, I think my lisp routine is messy and some lines are not necessary or clean enough. Can anyone tell me what's going wrong, espescially in this part:
(setq sstBlocks (ssget "X" '((0 . "INSERT"))))
(if (= sstBlocks nil)
(princ "\nNo blocks present in this drawing"))
(while (and (/= sstBlocks nil) (> (sslength sstBlocks) 0))
(princ (strcat "\nNumber of blocks to burst: "
(itoa (sslength sstBlocks))))
(sssetfirst nil sstBlocks)
(c:burst)
(setq sstBlocks nil)
(setq sstBlocks (ssget "X" '((0 . "INSERT"))))
)
Thank you in advance.
Solved! Go to Solution.