TheSwamp

CAD Forums => CAD General => Topic started by: STEVEDALLAS on March 05, 2008, 12:15:00 PM

Title: why does autocad 2008 insist on opening drawing1.dwg?
Post by: STEVEDALLAS on March 05, 2008, 12:15:00 PM
If I open the program first it opens drawing1.dwg. When I open a drawing, it keeps it open.
2004 did not, to my knowledge.
If I click on a dwg through windows explorer, it does not.

drawing1.dwg is kind of annoying.
not a big deal, though.

Just wondering if there is a way to get rid of drawing1.dwg.
Title: Re: why does autocad 2008 insist on opening drawing1.dwg?
Post by: Josh Nieman on March 05, 2008, 12:19:16 PM
It has to open it to complete loading Autocad.

There are various ways to automate closing this document just after it's open, and you can find them by doing a quick search.

There's not been any change through the versions that I recall.  It's always been a nuisance.  Possibly you only started adding things to your acaddoc.lsp since 2004?  Any customizations that are autoloaded or loaded via the acaddoc.lsp will be loaded AFTER a drawing opens, thus there WILL be some changes to the drawing, even if no changes are evident, thus neutralizing the autoclosure of the drawing once you open an intentional drawing.

Title: Re: why does autocad 2008 insist on opening drawing1.dwg?
Post by: sinc on March 05, 2008, 06:26:32 PM
It's simply lazy programming.  There is no reason that Autocad should need to open a document upon startup, except that Autodesk wrote it that way.

And it's been the same for years and years now.  If you startup Autocad, watching it create a Drawing1.dwg, and then immediately open another drawing, Autocad will automatically close the Drawing1.dwg file.  However, this assumes that you do NOTHING - not even scroll the screen - or the Drawing1.dwg file will be flagged as "dirty", and you will have to manually close it.

Note that things in your startup script, such as your ACAD.LSP or ACADDOC.LSP, may also do something that flags the Drawing1.dwg file as "dirty".  This is most-likely the difference you notice - in 2004, you weren't doing anything during startup that triggered the "dirty" flag, but now in 2008, you are.
Title: Re: why does autocad 2008 insist on opening drawing1.dwg?
Post by: STEVEDALLAS on March 06, 2008, 08:42:12 AM
Thanks guys.

Question.
Is there a piece of lisp code that I can add to my startup to close drawing1.dwg "IF" it is open?
Title: Re: why does autocad 2008 insist on opening drawing1.dwg?
Post by: ronjonp on March 06, 2008, 09:23:20 AM
I think you can only close it if it is not the active document. (but I could be wrong)

Here's something to close all drawing* (not current)

Code: [Select]
(defun c:closeDWG (/)
  (vlax-map-collection
    (vla-get-documents
      (vlax-get-Acad-Object)
    )
    '(lambda (x)
       (if (wcmatch (strcase (vla-get-name x)) "DRAWING*.DWG")
(vl-catch-all-apply 'vla-close (list x))
       )
     )
  )
  (princ)
)

Title: Re: why does autocad 2008 insist on opening drawing1.dwg?
Post by: STEVEDALLAS on March 06, 2008, 10:09:10 AM
Thanks ron
Title: Re: why does autocad 2008 insist on opening drawing1.dwg?
Post by: kentium3k on March 06, 2008, 10:22:10 AM
If you are going to start AutoCAD and immediately load an existing drawing why not have the startup dialog show and then browse to the file from there?  That way you won't have the drawing1.dwg.
Title: Re: why does autocad 2008 insist on opening drawing1.dwg?
Post by: ronjonp on March 06, 2008, 11:07:39 AM
Thanks ron

You're welcome.