Turning off the Message box ?

Turning off the Message box ?

Anonymous
Not applicable
421 Views
7 Replies
Message 1 of 8

Turning off the Message box ?

Anonymous
Not applicable
Can I turn off the message box that ask's if you want to save changes to a
drawing processing a list of drawings from VBA in Autocad 2002 ???

Thanks
Davey
0 Likes
422 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable
Right now, i just take the current drawing, get rid of everything in it, and save it as "junk" dwg file. The reason for sizing it down is for it to save the "junk" drawing much quicker. It seems to work good for getting around the message box when you don't want to save changes. I'll stay tuned to this dialog to see if there is a better way. The code:


Private Sub DiscardChanges()
Dim TemporaryFileName
Dim objEntity As AcadEntity

TemporaryFileName = "C:\Discard.dwg"

With ThisDrawing
For Each objEntity In .ModelSpace
objEntity.Delete
Next
For Each objEntity In .PaperSpace
objEntity.Delete
Next
Set objEntity = Nothing
End With
ThisDrawing.PurgeAll
ThisDrawing.SaveAs TemporaryFileName
End Sub
<\CODE>

HTH - Lanny
0 Likes
Message 3 of 8

Anonymous
Not applicable
Sorry -- i'm new to adding HTML to help orient text. Lets try this again:


Private Sub DiscardChanges()
On Error Resume Next

Dim TemporaryFileName
Dim objEntity As AcadEntity

TemporaryFileName = "C:\Discard.dwg"

With ThisDrawing
For Each objEntity In .ModelSpace
objEntity.Delete
Next
For Each objEntity In .PaperSpace
objEntity.Delete
Next
Set objEntity = Nothing
End With
ThisDrawing.PurgeAll
ThisDrawing.SaveAs TemporaryFileName
End Sub
0 Likes
Message 4 of 8

Anonymous
Not applicable
Can you just use;

ThisDrawing.ActiveDocument.Close False

--
Veign
www.veign.com
NEW ActiveX Control - Jeweled Style Buttons
www.veign.com/download_activex.html#jwldbutn
Code Samples & Sample Projects
http://www.veign.com/information/application/info_app.html
Submit Your Best Code (you keep the rights)
http://www.veign.com/information/application/code_submit.html
---------
"Davey" wrote in message
news:A04353FA3C38CEFC3FF30657DE482ABD@in.WebX.maYIadrTaRb...
> Can I turn off the message box that ask's if you want to save changes to a
> drawing processing a list of drawings from VBA in Autocad 2002 ???
>
> Thanks
> Davey
>
>
0 Likes
Message 5 of 8

Anonymous
Not applicable
Thanks Lansch / Veign.

However, I am using SDI mode.
Can you point me in the right direction ?

Thanks
Davey


"Davey" wrote in message
news:A04353FA3C38CEFC3FF30657DE482ABD@in.WebX.maYIadrTaRb...
> Can I turn off the message box that ask's if you want to save changes to a
> drawing processing a list of drawings from VBA in Autocad 2002 ???
>
> Thanks
> Davey
>
>
0 Likes
Message 6 of 8

Anonymous
Not applicable
To use the DiscardChanges sub(you might want to make it a public module -- i cut it from a much larger set of code in my project), you just do the following:


[do your changes to the current drawing]
DiscardChanges
Thisdrawing.Open "Next.dwg"


... this only needs to be done if working in SDI -- if you are using multiple documents, then you only need to close the document as Veign stated above. - Lanny
0 Likes
Message 7 of 8

Anonymous
Not applicable
Lanny

 

Is this the only way to do this in SDI mode
?

All that this program does is open the drawing,
zoom all and plot out to a specific plotter. I would rather not go through
manipulating the drawing due to speed restrictions.

 

Thanks

Davey


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
To
use the DiscardChanges sub(you might want to make it a public module -- i cut
it from a much larger set of code in my project), you just do the following:

 
[do your changes to the current drawing]
DiscardChanges
Thisdrawing.Open "Next.dwg"

... this only needs to be done if working in SDI -- if you are using
multiple documents, then you only need to close the document as Veign stated
above. - Lanny

0 Likes
Message 8 of 8

Anonymous
Not applicable
We print 11x17 shop drawings, and using this method seems to be a non-issue -- fast enough where you see the "plotting" box come up, and the next drawing comes up practically right away -- (about 25 - 40 drawings per minute here). - Lanny
0 Likes