PDA

View Full Version : Disabling new drawing at startup



Siberian
17th Aug 2007, 06:25 am
It annoys me that AutoCAD always opens a new drawing at startup...can I disable this somehow?

pefi
17th Aug 2007, 08:51 am
Another dirty hack....


(defun QuitIfEmpty ( / )
(if (and (= (getvar "SDI") 0) (= (ssget "_X") nil)) (command "_close"))
)
(QuitIfEmpty)Przemo

Alan Cullen
17th Aug 2007, 09:00 am
Pefi.....do I stick that in the acaddoc.lsp file?

Norts
17th Aug 2007, 09:08 am
The lisp posted above by pefi will only work if your AutoCAD starts up with a template that has no entities within it. e.g. if your template has layouts (paper or model) in it that contain borders for example then the above lisp will not work.
having said that, it is quite nifty :)

Alan Cullen
17th Aug 2007, 09:20 am
My template only has system settings etc I want.....no entities of any kind.....sorry for the thread-jack, Siberian.....but we are both after the same thing here......:lol:

So do I stick pefi's code in the acaddoc.lsp file?

Norts
17th Aug 2007, 09:32 am
Alan, I think you can either put it in your acaddoc.lsp or you can put in your appload startup suite.
i think either way would be fine. i did the latter of the 2 options i've listed here, and it worked ok.

pefi
17th Aug 2007, 09:52 am
The lisp posted above by pefi will only work if your AutoCAD starts up with a template that has no entities within it. e.g. if your template has layouts (paper or model) in it that contain borders for example then the above lisp will not work.
having said that, it is quite nifty :)

Yes, you're right - my mistake!
But I think I've got idea how to do it... stay in tune! :wink:
Przemo

pefi
17th Aug 2007, 09:54 am
My template only has system settings etc I want.....no entities of any kind.....sorry for the thread-jack, Siberian.....but we are both after the same thing here......:lol:

So do I stick pefi's code in the acaddoc.lsp file?

Yes, as Norts said..
Przemo

Alan Cullen
17th Aug 2007, 10:00 am
Cheers all, and thanks very much.....

Norts
17th Aug 2007, 10:09 am
Itsa nota problem

pefi
17th Aug 2007, 10:26 am
Dirty hack No. 2....


(defun QuitIfEmpty (/)
(vl-load-com)
(if (and (= (getvar "SDI") 0)
(= (vla-get-fullname
(vla-get-activedocument
(vla-get-application(vla-get-documents (vlax-get-acad-object)))))
""
)
)
(command "_close")
)
)(QuitIfEmpty)


I'm waiting for someboty to tell: "you can get the same result if you set system variable xyz to 0".... :)
Przemo

Siberian
21st Aug 2007, 10:33 pm
I don't seem to have the acaddoc.lsp anywhere...can I create it, and if so, where do I put it?

Alan Cullen
21st Aug 2007, 11:36 pm
yeah, create it and stick it in your acad\support folder.

SLW210
22nd Aug 2007, 12:59 am
I don't seem to have the acaddoc.lsp anywhere...can I create it, and if so, where do I put it?

It is here..................

C:\Program Files\AutoCAD 2008\Support

qball
21st Nov 2007, 10:49 pm
under "options - system tab", you could pick "show startup dialog box" on the right. then you pick a recently used drawing or browse instead of having a new, blank drawing open.

AFitchguy07
20th May 2010, 06:27 pm
in 2011 is this file called acad2011doc.lsp?

ReMark
20th May 2010, 06:44 pm
Do not edit acad2011doc.lsp. Edit acaddoc.lsp if you feel you must.

MSasu
20th May 2010, 06:45 pm
No, must use the acaddoc.lsp as suggested; the acad2011doc.lsp file is used by Autodesk and therefore should not be modified.

Regards,

ReMark
20th May 2010, 06:51 pm
Actually Dean Saadallah posted this over at the AutoDesk Discussion forums some time ago saying the advice came from the people at DOTSOFT. He said it needs to go in the acad.lsp file.

(defun-q mystartup ()
(while (eq 1 (logand 1 (getvar "CMDACTIVE"))))
(command "_CLOSE")
)
(setq S::STARTUP (append S::STARTUP mystartup))

DNK
20th May 2010, 06:55 pm
STARTUP at command line.

AFitchguy07
20th May 2010, 07:00 pm
okay....

that last bit confused me.

The title of thread says exactly what i want to happen, or i guess not happen. Which file is the correct file to edit?

there is no acaddoc.lsp in that dir.

also, which of the two sections of code do i insert into xxxxx.lsp? the first one or second one pefi (http://www.cadtutor.net/forum/member.php?u=2449) posted?

MSasu
20th May 2010, 07:08 pm
The acaddoc.lsp file is a user file - if doesn’t exist you should create it (it is a simple, text, file). More information here (http://www.cadtutor.net/forum/showthread.php?t=1390).

Regards,

ReMark
20th May 2010, 07:08 pm
Everything you need to know about acaddoc.lsp but were afraid to ask.

http://www.jtbworld.com/lisp/acaddoc.htm

ScribbleJ
20th May 2010, 07:24 pm
Just out of curiosity. Why does it annoy you so much that a new drawing opens up at start up of AutoCad?

MSasu
20th May 2010, 07:45 pm
also, which of the two sections of code do i insert into xxxxx.lsp? the first one or second one pefi (http://www.cadtutor.net/forum/member.php?u=2449) posted?

Are two different approaches, but the effect is the exactly the same; probably that first one will be faster (but with a negligible amount of time).

Regards,

AFitchguy07
20th May 2010, 08:11 pm
Just out of curiosity. Why does it annoy you so much that a new drawing opens up at start up of AutoCad?

because then i have to waste about 3 seconds of my life to close it and then reopen the one i want to work on opposed to just opening the one i want to work on. :roll:

MSasu
20th May 2010, 08:25 pm
Hope you are aware that opening an existing drawing will automatically the close the start-up one...

Regards,

gsksun4
20th May 2010, 08:33 pm
because then i have to waste about 3 seconds of my life to close it and then reopen the one i want to work on opposed to just opening the one i want to work on. :roll:

I just wondered about this. I have a new drawing open when I start Cad. Never bothers me because I'm ready to draw something new when I have to. But, I see your point. You go and close the new drawing every time. Then I did a little test. I opened an existing drawing also. I exited out of it and did not see the new drawing there anymore, so if you don't save as, it's basically a non drawing. So, you don't have to waste time closing two drawings when you leave Acad.
My point here is, let the new file open. Just do open for your existing drawing without closing the file that automatically opens, wasting 3 seconds each time when you start cad. Simple as that.
To each his own, and you certainly should have it your way, because you have to work with that setup.

gsksun4
20th May 2010, 08:35 pm
Hope you are aware that opening an existing drawing will automatically the close the start-up one...

Regards,

Masasu, you beat me to it, in a shorter post. Read my book above. I ramble on sometimes getting a point across. :D

AFitchguy07
20th May 2010, 08:48 pm
Hope you are aware that opening an existing drawing will automatically the close the start-up one...


yes but i don't keep all 100 million of them on my desktop, like my acad icon is. But i do get what you're saying.



I just wondered about this. I have a new drawing open when I start Cad. Never bothers me because I'm ready to draw something new when I have to. But, I see your point. You go and close the new drawing every time. Then I did a little test. I opened an existing drawing also. I exited out of it and did not see the new drawing there anymore, so if you don't save as, it's basically a non drawing. So, you don't have to waste time closing two drawings when you leave Acad.
My point here is, let the new file open. Just do open for your existing drawing without closing the file that automatically opens, wasting 3 seconds each time when you start cad. Simple as that.
To each his own, and you certainly should have it your way, because you have to work with that setup.
if i understand what you're saying correctly, then the new drawing that initially opens at launch will still be there, just not focused. i opened acad... boom, new dwg automatically. then, i open a dwg i prev worked on and it opens, but if you minimize that opened dwg, there sits the initial drawing1.dwg.

anyways, i tried the first script that was posted in first page, and this happened (it froze the app and ribbon never loaded - tsk mgr to close):

http://i50.tinypic.com/e97uo0.jpg
---

So i then just deleted the acaddoc.lsp and then reopened acad to see my ribbon is now gone. all i see is the red A or application center or what ever it is now called these days :(

alanjt
20th May 2010, 09:06 pm
How about...


(if (and (eq (getvar 'dwgname) "Drawing1.dwg")
(zerop (getvar 'sdi))
)
(progn (command "_.close")
(or (zerop (getvar 'dbmod)) (command "_Y"))
)
)

AFitchguy07
20th May 2010, 09:12 pm
How about...


(if (and (eq (getvar 'dwgname) "Drawing1.dwg")
(zerop (getvar 'sdi))
)
(progn (command "_.close")
(or (zerop (getvar 'dbmod)) (command "_Y"))
)
)

only thing that happened differently than before was that it didn't open full screen. It opened just enough to house the Welcome Screen. Completely frozen. I had to, again, close it via tsk mgr.

I will suffice with it prompting me to what to open at app launch via STARTUP command if i can get my ribbon back....

alanjt
20th May 2010, 09:15 pm
only thing that happened differently than before was that it didn't open full screen. It opened just enough to house the Welcome Screen. Completely frozen. I had to, again, close it via tsk mgr.

I will suffice with it prompting me to what to open at app launch via STARTUP command if i can get my ribbon back....
How odd, I tested it and it worked just as you would want. Not sure why Drawing1 is such an issue, but to each his own.

I don't fully understand what you are saying your problem is, but I"ll be more than happy to help.

AFitchguy07
20th May 2010, 09:18 pm
How odd, I tested it and it worked just as you would want. Not sure why Drawing1 is such an issue, but to each his own.

I don't fully understand what you are saying your problem is, but I"ll be more than happy to help.

i ran all 3 codes presented in this thread 2 from the other person, and one from you. the first one locked up autocad just as yours did. the second one on page 2 i believe it was did nothing visually that i noticed.

Now i delete acaddoc.lsp and open autocad and this is what i see:

http://i47.tinypic.com/w20d2a.jpg
---

ribbon gone.

i am using 2011 btw as you can see in my details, but i figured it was all the same since 2000.

ReMark
20th May 2010, 10:15 pm
Did you try typing the word RIBBON at the command line?

Sometimes it just doesn't pay to go messing with things that are mere gnats on the rump of an elephant.

AFitchguy07
20th May 2010, 10:21 pm
Did you try typing the word RIBBON at the command line?

Sometimes it just doesn't pay to go messing with things that are mere gnats on the rump of an elephant.

what i actually did was switch to 3d then back to 2d and it appeared back. I closed and re launched it and it was still there.

I would love other people to attempt these scripts on acad 2011 as i have and see if they get the same compilations that i have ran into.

For the mean time, i will settle with the STARTUP @ value of 1 as someone had suggested. That works out nicely because that saves me a half a second by not going up to the red A to open a new/existing document. Every half a second counts... i'm getting old.


Thanks again for everyone's help.

ReMark
20th May 2010, 10:27 pm
How about a hardware upgrade? I hear the 16 core computers are smokin'!

AFitchguy07
20th May 2010, 10:32 pm
How about a hardware upgrade? I hear the 16 core computers are smokin'!

i will stick with my core 2 duo. she runs like a champ.

...unless you'd like to fund a new i7 or i5 and new mobo to support those sockets for my desktop :)

i'll be replacing my old mbp with the new mbp 15" i5 in a few weeks. I'm excited.

alanjt
20th May 2010, 11:01 pm
It had unloaded your acad.cui I'm sure.

gsksun4
21st May 2010, 12:57 pm
if i understand what you're saying correctly, then the new drawing that initially opens at launch will still be there, just not focused. i opened acad... boom, new dwg automatically. then, i open a dwg i prev worked on and it opens, but if you minimize that opened dwg, there sits the initial drawing1.dwg.

http://i50.tinypic.com/e97uo0.jpg
---



For the record, what I and msasu are saying is forget about the initial dwg that comes up. Just ignor it and open your existing file. Unless you "save as" with that initial Drawing 1, it doesn't exist.
Msasu just said it in a shorter way. But good luck with the lisp routine anyway.:)

P.S., I'm using 2009LT and when I end out of an existing drawing, that start-up drawing isn't there.

ReMark
21st May 2010, 01:39 pm
For the amount of time it is going to "save" you is it really worth the effort? You probably waste more time texting your friends while supposedly working. LOL