Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

close without save

8 REPLIES 8
Reply
Message 1 of 9
showkata
432 Views, 8 Replies

close without save

Open a drawing done something. I want close this drawing without saving
Example

(setq SelSet (ssget "X" '((0 . "LWPOLYLINE")(8 . "MARBLE"))))
(setvar "filedia" 0)
(command "_Wblock" "NEWMARBLE "" "0,0" SelSet "")
(command "close")

it is asking confirmation to save or not
how can I set it ?
Thanks in advance
8 REPLIES 8
Message 2 of 9
Anonymous
in reply to: showkata

try this ...

(acad-push-dbmod)
...
...
...
(setq SelSet (ssget "X" '((0 . "LWPOLYLINE")(8 . "MARBLE"))))
(setvar "filedia" 0)
(command "_Wblock" "NEWMARBLE "" "0,0" SelSet "")
(acad-pop-dbmod)
(command "close")


"showkat" wrote in message
news:f144b05.-1@WebX.maYIadrTaRb...
> Open a drawing done something. I want close this drawing without saving
> Example
> (setq SelSet (ssget "X" '((0 . "LWPOLYLINE")(8 . "MARBLE"))))
> (setvar "filedia" 0)
> (command "_Wblock" "NEWMARBLE "" "0,0" SelSet "")
> (command "close")
>
> it is asking confirmation to save or not
> how can I set it ?
> Thanks in advance
>
>
Message 3 of 9
Anonymous
in reply to: showkata

This'll take 'er down. Don't let the neophytes know about it.

;Close active document, no save
(defun c:cln ()
(command "._VBASTMT"
"ThisDrawing.Application.ActiveDocument.Close(vbFalse)")
)
--
Cliff

"showkat" wrote in message
news:f144b05.-1@WebX.maYIadrTaRb...
> Open a drawing done something. I want close this drawing without saving
> Example
> (setq SelSet (ssget "X" '((0 . "LWPOLYLINE")(8 . "MARBLE"))))
> (setvar "filedia" 0)
> (command "_Wblock" "NEWMARBLE "" "0,0" SelSet "")
> (command "close")
>
> it is asking confirmation to save or not
> how can I set it ?
> Thanks in advance
>
Message 4 of 9
Anonymous
in reply to: showkata

Hi Cliff,
Ain't that a little overkill? 😉
(command "_.vbastmt" "thisdrawing.close vbfalse")

> (command "._VBASTMT"
> "ThisDrawing.Application.ActiveDocument.Close(vbFalse)")
> )
Message 5 of 9
Anonymous
in reply to: showkata

Being as I am, a farm boy, I like going around the barn to get to my
destination. I also notice you do not need the parens around the true/false
argument. On behalf of the lisping ghetto (minus showkat evidently), thank
you.
--
Cliff

"Doug Broad" wrote in message
news:7996888D67974755DC2B781F08494BD1@in.WebX.maYIadrTaRb...
> Hi Cliff,
> Ain't that a little overkill? 😉
> (command "_.vbastmt" "thisdrawing.close vbfalse")
>
> > (command "._VBASTMT"
> > "ThisDrawing.Application.ActiveDocument.Close(vbFalse)")
> > )
>
>
Message 6 of 9
Anonymous
in reply to: showkata

You're certainly welcome. Guess showkat is a Cheshire Cat 😉 ...)
(Mine doesn't work any better than yours. It's just less typing.)
Message 7 of 9
showkata
in reply to: showkata

Mr.Mark,Mr.Cliff Middleton & Mr.Doug Broad

1st solution
(command "._VBASTMT" "ThisDrawing.Application.ActiveDocument.Close(vbFalse)")

2nd solution
(command "_.vbastmt" "thisdrawing.close vbfalse")

Both statement are true. working fine

thanks your contribution
Message 8 of 9
Anonymous
in reply to: showkata

You're welcome.

1st solution = stinky
2nd solution = aaaaah

"showkat" wrote in message
news:f144b05.5@WebX.maYIadrTaRb...
> Mr.Mark,Mr.Cliff Middleton & Mr.Doug Broad
> 1st solution
> (command "._VBASTMT"
"ThisDrawing.Application.ActiveDocument.Close(vbFalse)")
>
> 2nd solution
> (command "_.vbastmt" "thisdrawing.close vbfalse")
>
> Both statement are true. working fine
>
> thanks your contribution
>
Message 9 of 9
chairpak
in reply to: showkata

Thank you,


This worked as well.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost