TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: andrew_nao on November 06, 2013, 11:37:33 AM

Title: need some ideas for a scrolling save message... (confusing i know)
Post by: andrew_nao on November 06, 2013, 11:37:33 AM
Code: [Select]
(defun c:nsave (/ activedoc docfullname backuppath archivename dwgbakk)
(vl-load-com)
(if (= (getvar "dwgtitled") 0)
 (PROGN
   (initdia)
   (command ".saveas")
 )
)
 
  (setq activedoc (vla-get-activedocument (vlax-get-acad-object)))
  ;;
(vla-save activedoc)
  (if (and (not (= 0 (strlen (setq docfullname (vla-get-fullname activedoc)))))
           (setq backuppath "C:\\ACADBACK\\")
           (setq archivename (strcat backuppath
                                     (vl-filename-base (vla-get-name activedoc))
                                     ".dwg"
                             )
           )
      )

    (setq dwgbakk (vl-file-copy docfullname archivename))
    (alert "Ooooops. Unable to get Filename.")
  )
  (if (= dwgbakk nil)
(progn
(vl-file-delete archivename)
(vl-file-copy docfullname archivename)
)
)
  (prompt (strcat "\n\nFile Saved..." archivename))
  (prompt (strcat "\n\nFile Saved..." docfullname))
  (princ)

)

here is my code for a custom save.
when "save" is clicked, it shows "file saved..."

if you click save over and over it, saves. but there is no way of it showing it saved again (it doesnt appear to scroll) unless you press f2 for the history window.

im looking for a way to have it display some type of scroll to show it saved again.

i hope this makes sense. and ideas are appreciated
Title: Re: need some ideas for a scrolling save message... (confusing i know)
Post by: ronjonp on November 06, 2013, 03:30:27 PM
You could use grtext to display: (grtext -2 (vla-get-fullname activedoc))
Title: Re: need some ideas for a scrolling save message... (confusing i know)
Post by: roy_043 on November 06, 2013, 04:36:47 PM
Just a question:
After using
Code: [Select]
(vla-save activedoc)Can
Code: [Select]
(vla-get-fullname activedoc)Ever return an empty string?