TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: V-Man on July 14, 2004, 09:25:06 AM
-
How do you get around the nagging question "Really want to discard all changes to drawing? <N>
in lisp
(command ".close" "Y") ;; does not work
-
Are you working in MDI mode?
-
Yes
-
So you want to close one of the _other_ dwg's?
-
Yes, I have a routine that will wblock out the currect drawing to create a clean drawing. I then want to close the drawing and DO NOT save changes.
(defun C:Cleanwblock ()
(princ "\nwMake a New Clean Drawing")
(setvar "FILEDIA" 0)
(setvar "CMDDIA" 0)
(setvar "CMDECHO" 1)
(command "-layer" "on" "*" "thaw" "*" "unlock" "*" "")
(command ".regen")
(if (setq jset (ssget "x"))
(progn
(setq jdwg (getvar "DWGNAME"))
(setq jpath (getvar "DWGPREFIX"))
(setq jfile (strcat jpath jdwg))
(if (findfile jfile )
(command "-wblock" jfile "Y" "" "0,0,0" "p" "" "N")
(command "-wblock" jfile "" "0,0,0" "p" "" "N")
)
)
(princ "\nNo Entities to Wblock")
)
(setvar "FILEDIA" 1)
(setvar "CMDDIA" 1)
(command "close" jfile) ;;<----This does not work..
(princ)
)
-
(command "VBASTMT" "ThisDrawing.Close(FALSE)")
could be a quit workaround.
-
That works. Thanks for the help.
-
Oops typo .. 'quick' not 'quit'
-
Yes, I have a routine that will wblock out the currect drawing to create a clean drawing. I then want to close the drawing and DO NOT save changes.
(defun C:Cleanwblock ()
(princ "\nwMake a New Clean Drawing")
- dvarino
I don't get it!!
When I run this I get a dwg with nothing in it :-/
-
I don't get it!!
When I run this I get a dwg with nothing in it :-/
It works fine here.
-
I don't get it!!
When I run this I get a dwg with nothing in it :-/
It works fine here.
Ok. What do you get? What version of ACAD are you running this in?
-
Ok. What do you get? What version of ACAD are you running this in?
When I run the command it selects everything in the CAD file and wblocks it out on top of itself then the routine closes the file and DOES NOT save changes because if it did it would overwrite what I just wblocked and the drawing would be BLANK
.
Autocad Map5
Command: (getvar "acadver")
"15.06"