Jump to content

Disabling new drawing at startup


Siberian

Recommended Posts

  • Replies 40
  • Created
  • Last Reply

Top Posters In This Topic

  • AFitchguy07

    8

  • ReMark

    6

  • pefi

    4

  • MSasu

    4

Another dirty hack....

 

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

Przemo

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

Guest Alan Cullen

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 2 months later...

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.

Link to comment
Share on other sites

  • 2 years later...

No, must use the acaddoc.lsp as suggested; the acad2011doc.lsp file is used by Autodesk and therefore should not be modified.

 

Regards,

Link to comment
Share on other sites

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))

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...