LISP crashing Autocad on last line of code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Good afternoon everyone! I have this routine that is just about done except that it crashes autocad or gets into an infinite loop right at the end. Everything crashes when I re-open the original file. If I comment that and everything below it out, it works. If I break them into 2 lisp commands, both halves work perfectly fine. It's just when they're in the same file or if the second half LISP is being called from within the first. Even if I have both halves as functions and try to call them from a 3rd LISP, even if I put delays and repeat the command for the 2nd half over and over, it just ignores the second half. Thank you to everyone for your time!
(defun c:TakeItAll ()
;set SDI to 1 [Single-Drawing Interface],
(setvar "filedia" 0)
(setvar "SDI" 1)
;QSAVE the current drawing,
(command "_qsave")
;OPEN the other one [which will CLOSE the current one],
(command "_.open" "c:\\source\\filepath")
;select all lines on layer 1-4
(command "._copybase" "_non" '(0 0) (ssget "_X" '((8 . "layer1, layer2, layer3, layer4"))) "")
;--------End of first half---------;
;--------beginning of second half---------;
;open original file [<---- Locks up/eternally loops somewhere around here.]
(command "_.open" "_Y" "C:\\target\\filepath")
;and paste to coordinates
(command "_.pasteclip" '(100 100))
;reset filedia and sdi
(setvar "filedia" 1)
(setvar "SDI" 0)
;lay back and greet our robot overlords
)