<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Save drawing to new name in Visual Lisp reactor in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11587865#M37707</link>
    <description>&lt;P&gt;&lt;A href="https://apps.autodesk.com/ACD/en/Detail/Index?id=7509260174078723201&amp;amp;appLang=en&amp;amp;os=Win32_64" target="_blank" rel="noopener"&gt;THIS&lt;/A&gt; add-on does not work for you?&lt;/P&gt;</description>
    <pubDate>Wed, 30 Nov 2022 13:16:45 GMT</pubDate>
    <dc:creator>ВeekeeCZ</dc:creator>
    <dc:date>2022-11-30T13:16:45Z</dc:date>
    <item>
      <title>Save drawing to new name in Visual Lisp reactor</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11585653#M37702</link>
      <description>&lt;P&gt;Been attempting this for weeks now, learned a lot from the internet. Getting the impression this can only be done one way. I don't like the visual outcome. Hoping someone might know a better way, or at least how to suppress visual appearance on the command history.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As being in the reactor, cannot use "COMMAND" or "VL-CMDF" to do "SAVE".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Visual Lisp programmers messed up. They created "VLA-SAVEAS" &amp;amp; "VLA-SAVE". "VLA-SAVE" is actually "QSAVE" and there is no function for "SAVE" in Visual Lisp, that I have found.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes. I need to do a "SAVE" as I do not want to "QSAVE" the current drawing. I may not wish to save the changes when I close the drawing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, in my search I found one post on the forums where it was suggested to use "VLA-SENDCOMMAND". This function would be fine except by the nature of the function, everything sent is displayed on the command history. And as the SAVE command issues the browse dialog, it is required to turn off the sysvar "filedia" before sending the command "SAVE". In addition, the "VLA-SENDCOMMAND" is asynchronous and therefore does not always execute as laid out in the LISP code. I have found that this works (but sometimes the vla-sendcommand function fails) so I would rather find another way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(vla-sendcommand (vla-get-activedocument (vlax-get-acad-object)) "(setvar \"filedia\" 0) ")
(vla-sendcommand (vla-get-activedocument (vlax-get-acad-object)) (strcat "_.save " "\"" STR:FOLDER STR:SFNAME "\"" "\r"))
(vla-sendcommand (vla-get-activedocument (vlax-get-acad-object)) "(setvar \"filedia\" 1) ")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But everything else I have tried, does not work.&lt;/P&gt;&lt;P&gt;Something I have tried is:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(setvar "filedia" 0)
(vla-sendcommand (vla-get-activedocument (vlax-get-acad-object)) (strcat "_.save " "\"" STR:FOLDER STR:SFNAME "\"" "\r"))
(setvar "filedia" 1)&lt;/LI-CODE&gt;&lt;P&gt;Result is "fildia" being set out of order.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found a suggestion to use a reactor for control of the "filedia".&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(vlr-lisp-reactor (cons FD (getvar "filedia")) '((:vlr-lispended . SG-RESTORE-FD)))&lt;/LI-CODE&gt;&lt;P&gt;However, it did not fire as expected.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2022 15:58:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11585653#M37702</guid>
      <dc:creator>dvertz</dc:creator>
      <dc:date>2022-11-29T15:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: Save drawing to new name in Visual Lisp reactor</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11587068#M37703</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/393249"&gt;@dvertz&lt;/a&gt;&amp;nbsp;hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;why can you use (getfiled) + (vla-saveas FileName) ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Moshe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 06:14:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11587068#M37703</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2022-11-30T06:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: Save drawing to new name in Visual Lisp reactor</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11587632#M37704</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/393249"&gt;@dvertz&lt;/a&gt; try&lt;/P&gt;
&lt;LI-CODE lang="lisp"&gt;(setvar "filedia" 0)
(vla-sendcommand (vla-get-activedocument (vlax-get-acad-object)) (strcat "_.save " "\"" STR:FOLDER STR:SFNAME "\"" "\rfiledia\r1\r"))&lt;/LI-CODE&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;Hope this helps, &lt;BR /&gt;Henrique&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 11:09:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11587632#M37704</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2022-11-30T11:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: Save drawing to new name in Visual Lisp reactor</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11587787#M37705</link>
      <description>&lt;P&gt;Moshe-A,&lt;/P&gt;&lt;P&gt;Thank you for your suggestion. But I don't see how this helps. As being inside a reactor, the GETFILED would be just the same as not setting FILDIA. All dialogs need suppression. SAVEAS would also present a problem as it sets the current drawing to that file. I would like to keep the current file path and name as it currently is.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 12:38:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11587787#M37705</guid>
      <dc:creator>dvertz</dc:creator>
      <dc:date>2022-11-30T12:38:13Z</dc:date>
    </item>
    <item>
      <title>Re: Save drawing to new name in Visual Lisp reactor</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11587817#M37706</link>
      <description>&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;A href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/75977" target="_self"&gt;&lt;SPAN class=""&gt;hmsilva&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;, Thank you for your suggestion.&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;I have tried many things and this was one of them. I had also tried placing the value of FILDIA in a variable to restore to whatever the user could have it currently set to. This does work for the most part. The larger issue is sometimes VLA-SENDCOMMAND fails with the only way to restore the function is to close the drawing and re-open. When that happens, it leaves FILEDIA in the incorrect state. Would you know why VLA-SENDCOMMAND might sometimes fail?&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;I was hoping for an answer that could take me away from VLA-SENDCOMMAND. I was looking at using vla-wblock instead (posted to another thread).&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 30 Nov 2022 12:55:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11587817#M37706</guid>
      <dc:creator>dvertz</dc:creator>
      <dc:date>2022-11-30T12:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: Save drawing to new name in Visual Lisp reactor</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11587865#M37707</link>
      <description>&lt;P&gt;&lt;A href="https://apps.autodesk.com/ACD/en/Detail/Index?id=7509260174078723201&amp;amp;appLang=en&amp;amp;os=Win32_64" target="_blank" rel="noopener"&gt;THIS&lt;/A&gt; add-on does not work for you?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 13:16:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11587865#M37707</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2022-11-30T13:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: Save drawing to new name in Visual Lisp reactor</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11587880#M37708</link>
      <description>&lt;P&gt;Ah, You found the one I am currently using and have been for years. When CAD-Studio sold to Arkance, they started changing the Add-On. It is currently in a very annoying Trial state where it keeps poping up the web browser. Plus I wanted to add some features they don't have. So, I have been writing my own. My interface is done and working great (including the reactors that fire). But its the saving part I am having trouble with. I think I am going to find that Visual Lisp cannot do it.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 13:23:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11587880#M37708</guid>
      <dc:creator>dvertz</dc:creator>
      <dc:date>2022-11-30T13:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: Save drawing to new name in Visual Lisp reactor</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11587943#M37709</link>
      <description>&lt;P&gt;And those features you're talking about, does it makes sense to suggest to them to include those in it? Have you tried to ask them?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 13:43:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11587943#M37709</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2022-11-30T13:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: Save drawing to new name in Visual Lisp reactor</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11588083#M37710</link>
      <description>&lt;P&gt;BeekeeCZ,&lt;/P&gt;&lt;P&gt;I have not tried to ask them or make suggestions. I gave up on emailing them when they would not reply to other emails I sent them.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 14:29:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11588083#M37710</guid>
      <dc:creator>dvertz</dc:creator>
      <dc:date>2022-11-30T14:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: Save drawing to new name in Visual Lisp reactor</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11588292#M37711</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/393249"&gt;@dvertz&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;DIV class=""&gt;...&lt;/DIV&gt;
&lt;DIV class=""&gt;I have tried many things and this was one of them. I had also tried placing the value of FILDIA in a variable to restore to whatever the user could have it currently set to. This does work for the most part. The larger issue is sometimes VLA-SENDCOMMAND fails with the only way to restore the function is to close the drawing and re-open. When that happens, it leaves FILEDIA in the incorrect state. Would you know why VLA-SENDCOMMAND might sometimes fail?&lt;/DIV&gt;
&lt;DIV class=""&gt;...&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I don't recall sendcommand fail&lt;BR /&gt;Are you using a command reactor, to catch the save, qsave?&lt;BR /&gt;Show us a code snippet.&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;Henrique&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 15:41:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11588292#M37711</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2022-11-30T15:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: Save drawing to new name in Visual Lisp reactor</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11589223#M37712</link>
      <description>&lt;P&gt;hmsilva,&lt;/P&gt;&lt;P&gt;No. Not a command reactor, yes a reactor. The editor reactor. Should it be the command reactor instead?&lt;/P&gt;&lt;P&gt;My code is a disarray of comments right now as I work through this situation. So I have copied and pasted the pertinent code. It is not all of the code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun SG-REACTOR ()
  (if (or (= STR:QSAVES "1") (= STR:AUTOSV "1"))
    (progn
      (if (not *DSReactor*) (setq *DSReactor* (vlr-editor-reactor nil '((:vlr-beginSave . DS-changed)))))
      (if (not *SCReactor*) (setq *SCReactor* (vlr-editor-reactor nil '((:vlr-saveComplete . SC-changed)))))
    )
  )
)

(defun DS-changed (DS-data DS-callback / )

  (setq STR:SFNAME STR:FORMAT)
  (SG-DATETIME)
  (SG-SFNAME)
  (if (and (= STR:QSAVES "1") (= (getvar "cmdnames") "QSAVE"))
    (progn
      (princ (strcat "\nSafeGuard&amp;gt; Performing QSAVE " STR:FOLDER STR:SFNAME " ... "))
      (SG-SAVEDWG)
    )
  )
  (if (and (= STR:AUTOSV "1")(= (getvar "cmdnames") nil))
    (progn
      (princ (strcat "\nSafeGuard&amp;gt; Performing AutoSAVE " STR:FOLDER STR:SFNAME " ... "))
      (SG-SAVEDWG)
    )
  )
)
(defun SG-SAVEDWG ( / )
  (cond ((= STR:METHOD "0")
          (setq temp (strcat "_.save " "\"" STR:FOLDER STR:SFNAME "\"" "\r"))
          (vla-sendcommand (vla-get-activedocument (vlax-get-acad-object)) "(setvar \"filedia\" 0) ")
          (vla-sendcommand (vla-get-activedocument (vlax-get-acad-object)) temp) ; (strcat "_.save" " " temp " "))
          (vla-sendcommand (vla-get-activedocument (vlax-get-acad-object)) "(setvar \"filedia\" 1) ")
          ;(vla-sendcommand (vla-get-activedocument (vlax-get-acad-object)) (strcat "(setvar \"filedia\" " (itoa FD) ") "))
        )
  )
)
(defun SG-DATETIME ()
      (setq STR:NOW (rtos (getvar "cdate") 2 8)) ;20031119.173505
      (setq STR:YEAR (substr STR:NOW 1 4)) ;2003
      (setq STR:YR (substr STR:NOW 3 2)) ;03
      (setq STR:MNTH (substr STR:NOW 5 2)) ;11
      (setq STR:DAY (substr STR:NOW 7 2)) ;19
      (setq STR:HOUR (substr STR:NOW 10 2)) ;17
      (setq STR:MIN (substr STR:NOW 12 2)) ;35
      (setq STR:SEC (substr STR:NOW 14 2)) ;05
)
(defun SG-SFNAME ()
  ;; (setq STR:FORMAT "SG $yyyy$mm$dd-$HH$MM$SS_$n$e") (C:\\temp\\SG 20031119-173505-PreSubPlat.dwg)
  (setq STR:MONTH (list "January" "February" "March" "April" "May" "June" "July" "August" "September" "October" "November" "December"))
  (setq STR:MMM (list "Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sept" "Oct" "Nov" "Dec"))
  (setq STR:DDD (nth (fix (rem (1+ (getvar "date")) 7)) '("Sun" "Mon" "Tue" "Wed" "Thu" "Fri" "Sat")))
  (setq STR:DAYS (nth (fix (rem (1+ (getvar "date")) 7)) '("Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday" "Sunday")))

  (setq STR:SFNAME (vl-string-subst STR:YEAR "$yyyy" STR:SFNAME)) ;2003
  (setq STR:SFNAME (vl-string-subst STR:YR "$yy" STR:SFNAME))     ;03

  (if (= (substr STR:MNTH 1 1) "0") (setq STR:MON (substr STR:MNTH 2 1))(setq STR:MON STR:MNTH))
  (setq STR:SFNAME (vl-string-subst (nth (1- (atoi STR:MON)) STR:MMM) "$mmm" STR:SFNAME)) ;Mar
  (setq STR:SFNAME (vl-string-subst (nth (1- (atoi STR:MON)) STR:MONTH) "$mon" STR:SFNAME)) ;March

  (setq STR:SFNAME (vl-string-subst STR:MNTH "$mm" STR:SFNAME))   ;11
  (if (= (substr STR:MNTH 1 1) "0") (setq STR:MNTH (substr STR:MNTH 2 1)))
  (setq STR:SFNAME (vl-string-subst STR:MNTH "$m" STR:SFNAME))   ;1

  (setq STR:SFNAME (vl-string-subst STR:DDD "$ddd" STR:SFNAME)) ;Mon
  (setq STR:SFNAME (vl-string-subst STR:DAYS "$day" STR:SFNAME)) ;Monday

  (setq STR:SFNAME (vl-string-subst STR:DAY "$dd" STR:SFNAME))    ;19
  (if (= (substr STR:DAY 1 1) "0") (setq STR:DAY (substr STR:DAY 2 1)))
  (setq STR:SFNAME (vl-string-subst STR:DAY "$d" STR:SFNAME))   ;1

  (setq STR:SFNAME (vl-string-subst STR:HOUR "$HH" STR:SFNAME))   ;17
  (if (= (substr STR:HOUR 1 1) "0") (setq STR:HOUR (substr STR:HOUR 2 1)))
  (setq STR:SFNAME (vl-string-subst STR:HOUR "$H" STR:SFNAME))   ;1

  (setq STR:SFNAME (vl-string-subst STR:MIN "$MM" STR:SFNAME))    ;35
  (if (= (substr STR:MIN 1 1) "0") (setq STR:MIN (substr STR:MIN 2 1)))
  (setq STR:SFNAME (vl-string-subst STR:MIN "$M" STR:SFNAME))   ;3

  (setq STR:SFNAME (vl-string-subst STR:SEC "$SS" STR:SFNAME))    ;05
  (if (= (substr STR:SEC 1 1) "0") (setq STR:SEC (substr STR:SEC 2 1)))
  (setq STR:SFNAME (vl-string-subst STR:SEC "$S" STR:SFNAME))   ;5

  (setq STR:SFNAME (vl-string-subst (vl-filename-base (getvar "DWGNAME")) "$n" STR:SFNAME))
  (setq STR:SFNAME (vl-string-subst (vl-filename-extension (getvar "DWGNAME")) "$e" STR:SFNAME))
)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 30 Nov 2022 21:55:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11589223#M37712</guid>
      <dc:creator>dvertz</dc:creator>
      <dc:date>2022-11-30T21:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: Save drawing to new name in Visual Lisp reactor</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11589272#M37713</link>
      <description>&lt;P&gt;I put this together a while back. It makes 15 minute backups of a drawing stored like so:&lt;BR /&gt;&lt;BR /&gt;"C:\AutoCAD-BAK\2022.11.30\12-15\PROJECT.FOLDER1.FOLDER2\Drawing.dwg"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe you can find a use for it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="lisp"&gt;(defun rjp-backupdwg (/ _date bd copyp d date dcp dp dwgp h m)
  ;; RJP » 2016-05-10
  (defun _date (f) (menucmd (strcat "M=$(edtime,$(getvar,date)," f ")")))
  (cond	((and (= 1 (getvar 'dwgtitled) (getvar 'writestat))
	      (or (vl-file-directory-p (setq bd (strcat (getenv "homedrive") "\\AutoCAD-BAK\\")))
		  (vl-mkdir bd)
	      )
	 )
	 (setq dp    (getvar 'dwgprefix)
	       date  (_date "YYYY.MO.DD/")
	       m     (itoa (abs (- (rem (setq m (atoi (_date "MM"))) 15) m)))
	       h     (strcat (_date "HH")
			     "-"
			     (if (= m "0")
			       "0"
			       ""
			     )
			     m
			     "/"
		     )
	       dcp   (strcat (vl-string-right-trim "." (substr (vl-string-translate "\\\"" "." dp) 4)) "/")
	       copyp (strcat bd date h dcp (getvar 'dwgname))
	       dwgp  (strcat dp (getvar 'dwgname))
	 )
	 (vl-mkdir (setq d (strcat bd date)))
	 (vl-mkdir (setq d (strcat d h)))
	 (vl-mkdir (setq d (strcat d dcp)))
	 (and (findfile copyp) (vl-file-delete copyp))
	 (and (vl-file-directory-p d) (vl-file-copy dwgp copyp))
	)
  )
  (princ)
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 22:22:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11589272#M37713</guid>
      <dc:creator>ronjonp</dc:creator>
      <dc:date>2022-11-30T22:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: Save drawing to new name in Visual Lisp reactor</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11590599#M37714</link>
      <description>&lt;P&gt;ronjonp,&lt;/P&gt;&lt;P&gt;Thanks for the code. It appears to be making a copy of the the last time the current drawing was saved. I am looking to save changes up to the latest changes which may not have been saved yet.&lt;/P&gt;&lt;P&gt;One thing I see in the code that will be helpful is the variable I didn't know about "writestat". Nice way to check for read-only status, Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 12:58:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11590599#M37714</guid>
      <dc:creator>dvertz</dc:creator>
      <dc:date>2022-12-01T12:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: Save drawing to new name in Visual Lisp reactor</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11590755#M37715</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/393249"&gt;@dvertz&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt; I am looking to save changes up to the latest changes which may not have been saved yet.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/393249"&gt;@dvertz&lt;/a&gt;&amp;nbsp;it's&amp;nbsp;your goal to save a copy each time a change is made in the current dwg?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 14:10:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11590755#M37715</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2022-12-01T14:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: Save drawing to new name in Visual Lisp reactor</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11591029#M37716</link>
      <description>&lt;P&gt;Yes. And No. Copy being the key.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not to save the current drawing. Save a copy of the current drawing in the current state.&lt;/P&gt;&lt;P&gt;Not with a change of the drawing but when the reactor is fired.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 15:49:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11591029#M37716</guid>
      <dc:creator>dvertz</dc:creator>
      <dc:date>2022-12-01T15:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: Save drawing to new name in Visual Lisp reactor</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11591061#M37717</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/393249"&gt;@dvertz&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Yes. And No. Copy being the key.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not to save the current drawing. Save a copy of the current drawing in the current state.&lt;/P&gt;
&lt;P&gt;Not with a change of the drawing but when the reactor is fired.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/393249"&gt;@dvertz&lt;/a&gt;&amp;nbsp;if the dwg is too&amp;nbsp; big it will be painful to save a copy in every command...&lt;/P&gt;
&lt;P&gt;As a demo...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="lisp"&gt;(vl-load-com)
(defun c:demo ()
    (defun MY_BK (rea clb)
	(if (and (not (wcmatch (strcase (car clb)) "*SAVE*,*ZOOM*,*PAN*,*REGEN*"))
		 (eq 1 (logand 1 (getvar 'DBMOD)))
	    )
	    (progn
		(setq dwg (vla-get-activedocument (vlax-get-acad-object)))
		(vla-sendcommand dwg "Backuping\r")
	    )
	)
    )
    (if	*BKReactor
	(progn
	    (vlr-remove *BKReactor)
	    (setq *BKReactor nil
		  MY_BK	nil
	    )
	    (prompt "\n&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; MY_BK reactor is stopped!!! ")
	)
	(progn
	    (setq *BKReactor (vlr-command-reactor "Backup reactor" '((:vlr-commandEnded . MY_BK))))
	    (prompt "\n&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; MY_BK reactor is starting!!! ")
	)
    )
    (princ)
)

(defun c:backuping (/ *error* old_echo)
    (defun *error* (msg)
	(if old_echo
	    (setvar 'CMDECHO old_echo)
	)
	(cond
	    ((not msg))
	    ((wcmatch (strcase msg) "*QUIT*,*CANCEL*"))
	    (T (princ (strcat "\nError: " msg)))
	)
	(princ)
    )
    (setq old_echo (getvar 'CMDECHO))
    (setvar 'CMDECHO 0)
    (setq date (rtos (getvar 'CDATE) 2 6))
    (command "_.save" (strcat (getvar 'DWGPREFIX) (vl-filename-base (getvar 'DWGNAME)) "_" (substr date 5 2) "-" (substr date 7 2) "-" (substr date 1 4) "-" (substr date 10 2) "-" (substr date 12 2) "-" (substr date 14 2) ".dwg"))
    (setvar 'CMDECHO 1)
    (command)
    (princ)
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps, &lt;BR /&gt;Henrique&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 15:39:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11591061#M37717</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2022-12-05T15:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: Save drawing to new name in Visual Lisp reactor</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11597599#M37718</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;there is no dead trial state of SureSave, this addon is still being updated (see the History on &lt;A href="https://www.cadstudio.cz/en/apps/suresave/" target="_blank"&gt;https://www.cadstudio.cz/en/apps/suresave/&lt;/A&gt;). The web "pop-up" just reminds you that there is a newer, updated version of the app for download. Just download and install it - you will see no more pop-ups and you will get new functionality.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Vladimir Michl, &lt;A href="http://www.arkance-systems.cz" target="_blank"&gt;www.arkance-systems.cz&lt;/A&gt; - &lt;A href="http://www.cadforum.cz" target="_blank"&gt;www.cadforum.cz&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 09:23:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/save-drawing-to-new-name-in-visual-lisp-reactor/m-p/11597599#M37718</guid>
      <dc:creator>vladimir_michl</dc:creator>
      <dc:date>2022-12-05T09:23:10Z</dc:date>
    </item>
  </channel>
</rss>

