Jump to content

Recommended Posts

Posted

Not sure if this would be a script of a lisp...so recommendations please.

 

When trying to exit a single drawing file, I would like the following to happen when I type 'exit'

- zoom extents

- layer back to '0'

- save drawing

- close drawing

 

If this would be a script...how do I permenently load a script and make sure it loads everytime I start up CAD?

Posted
Not sure if this would be a script of a lisp...

...and button macro. Let"s experiment...

(now your turn)

Posted

Try this .... :D

 

(defun c:MyExit nil
 ;; Tharwat 18. Nov. 2011 ;;
 (command "_.zoom" "_extents")
 (setvar 'clayer "0")
 (if (eq (getvar 'dwgtitled) 1)
   (progn
     (command "_.save" "")
     (command "_.close" "")
   )
   (alert
     "Save your drawing first and come back after that !!!"
   )
 )

 (princ)
)

Posted

Here's a freebie:

 

(defun c:FOO  ()
 (vl-load-com)
 (setvar 'clayer "0")
 (foreach x  '(("._zoom" "extents")
               ("._qsave")
               ("._close"))
   (vl-catch-all-apply 'vl-cmdf x)))

Posted

Very nice way of coding Renderman and I missed you a lot buddy . :)

 

What's if the file is not already saved and does not have a title ?

Posted
Very nice way of coding Renderman and I missed you a lot buddy . :)

 

Thanks Tharwat; yeah it's been a while since I've been able to hang out. I'll try to visit more often. :beer:

 

What's if the file is not already saved and does not have a title ?

 

^^ I'm Clark Gable on this one... "Frank, my dear, I don't give a damn."

 

gonewind.jpg

Posted

 

^^ I'm Clark Gable on this one... "Frank, my dear, I don't give a damn."

 

No worries.

 

Cheers ..... :beer:

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