Author Topic: why does autocad 2008 insist on opening drawing1.dwg?  (Read 3188 times)

0 Members and 1 Guest are viewing this topic.

STEVEDALLAS

  • Guest
why does autocad 2008 insist on opening drawing1.dwg?
« 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.

Josh Nieman

  • Guest
Re: why does autocad 2008 insist on opening drawing1.dwg?
« Reply #1 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.


sinc

  • Guest
Re: why does autocad 2008 insist on opening drawing1.dwg?
« Reply #2 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.

STEVEDALLAS

  • Guest
Re: why does autocad 2008 insist on opening drawing1.dwg?
« Reply #3 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?

ronjonp

  • Needs a day job
  • Posts: 7529
Re: why does autocad 2008 insist on opening drawing1.dwg?
« Reply #4 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)
)

« Last Edit: March 06, 2008, 09:36:42 AM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

STEVEDALLAS

  • Guest
Re: why does autocad 2008 insist on opening drawing1.dwg?
« Reply #5 on: March 06, 2008, 10:09:10 AM »
Thanks ron

kentium3k

  • Newt
  • Posts: 54
  • Adopt a Greyhound! No, not a bus.
Re: why does autocad 2008 insist on opening drawing1.dwg?
« Reply #6 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.
Prosperity is only an instrument to be used, not a deity to be worshiped. C. Coolidge

ronjonp

  • Needs a day job
  • Posts: 7529
Re: why does autocad 2008 insist on opening drawing1.dwg?
« Reply #7 on: March 06, 2008, 11:07:39 AM »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC