What causes default Plot-To-File path to differ from Browse for Plot File default?

What causes default Plot-To-File path to differ from Browse for Plot File default?

hencoop
Advisor Advisor
1,226 Views
5 Replies
Message 1 of 6

What causes default Plot-To-File path to differ from Browse for Plot File default?

hencoop
Advisor
Advisor

My default Plot-to-File path is:

hencoop_0-1704230764015.png

However, the actual default folder in the 'Browse for Plot File dialog (default Save path) is:

hencoop_1-1704230803827.png

 

 

AutoCAD User since 1989. Civil Engineering Professional since 1983
Product Version: 13.6.1963.0 Civil 3D 2024.4.1 Update Built on: U.202.0.0 AutoCAD 2024.1.6
                        27.0.37.14 Autodesk AutoCAD Map 3D 2024.0.1
                        8.6.52.0 AutoCAD Architecture 2024
0 Likes
Accepted solutions (2)
1,227 Views
5 Replies
Replies (5)
Message 2 of 6

Kevin.Spear
Advisor
Advisor

Good morning or afternoon... 🙂 It appears that the path for plot files specified in OPTIONS is only a starting location. If you save a plot file anywhere else, that new path is saved in the current application session. Closing the application clears the saved path and reverts to the path specified in OPTIONS. 

Maybe suggest a workflow that always plots to that folder and then move the file to the appropriate project folder?

Thanks
Kevin

Kevin Spear, PE
0 Likes
Message 3 of 6

hencoop
Advisor
Advisor

@Kevin.Spear do you have any idea where AutoCAD stores the path last used?  If I could reset that (autolisp/visual lisp) then it would be what I need every time.

AutoCAD User since 1989. Civil Engineering Professional since 1983
Product Version: 13.6.1963.0 Civil 3D 2024.4.1 Update Built on: U.202.0.0 AutoCAD 2024.1.6
                        27.0.37.14 Autodesk AutoCAD Map 3D 2024.0.1
                        8.6.52.0 AutoCAD Architecture 2024
0 Likes
Message 4 of 6

Kevin.Spear
Advisor
Advisor
Accepted solution

I don't know what setting drives that change. Browsing the registry I came across a couple of keys that store the default location and the current location. The default is used on restart. When you save somewhere else, the current location is saved and used thereafter. They are separate keys.
I'm not sure what your goal is, but one option is to save to the DWG folder using a LSP. BTW, all of this is in this support article - https://www.autodesk.com/support/technical/article/caas/sfdcarticles/sfdcarticles/how-to-make-autoca...

 

This lisp could be used to set a hard coded path you use in OPTIONs as well.

Thanks
Kevin

Kevin Spear, PE
0 Likes
Message 5 of 6

hencoop
Advisor
Advisor
Accepted solution

@Kevin.Spear Thank you!  It turns out that my issue may have been solved by installing the latest update or just by restarting AutoCAD.  I have used a lisp routine for years now that sets my DEFAULTPLOTTOFILEPATH to a specific subfolder in my project folder tree.  The reason for my OP is that it quit working.  To my surprise, it is working again today.
This is the program I use:

(DEFUN C:SETDEFPLOT ()
  (IF DOS_MKDIR
    nil
    (PROGN (LOAD "CHECK_FOR_DOSLIB" "\NFile CHECK_FOR_DOSLIB.LSP not loaded! ") (check_for_doslib))
  ) ;_ end of IF
  (IF DOS_MKDIR
    (PROGN ;;make sure vl- functions work
           (IF debug-reactor
             (PROGN
               (PRINC "\nSETDEFPLOT: begin (PROGN ...) ")
               (PRINC)
             )
           )
           (VL-LOAD-COM)
           ;;get the acad application
           (IF acad-object
             (acad-object)
             (SETQ *acad-object* (VLAX-GET-ACAD-OBJECT))
           )
           ;;get the application preferences,
           (SETQ prefs (VLA-GET-PREFERENCES *acad-object*))
           ;;prefs object has the following properties which give access to the tabs in the Options Dialog:
               ;   Application (RO) = #<VLA-OBJECT IAcadApplication 000000013fc43318>
               ;   Display (RO) = #<VLA-OBJECT IAcadPreferencesDisplay 000000005bc78f28>
               ;   Drafting (RO) = #<VLA-OBJECT IAcadPreferencesDrafting 000000005bc78f20>
               ;   Files (RO) = #<VLA-OBJECT IAcadPreferencesFiles 000000005bc78f30>
               ;   OpenSave (RO) = #<VLA-OBJECT IAcadPreferencesOpenSave 000000005bc78f38>
               ;   Output (RO) = #<VLA-OBJECT IAcadPreferencesOutput 000000005bc78f40>
               ;   Profiles (RO) = #<VLA-OBJECT IAcadPreferencesProfiles 000000005bc78f48>
               ;   Selection (RO) = #<VLA-OBJECT IAcadPreferencesSelection 000000005bc78f50>
               ;   System (RO) = #<VLA-OBJECT IAcadPreferencesSystem 000000005bc78f58>
               ;   User (RO) = #<VLA-OBJECT IAcadPreferencesUser 000000005bc78f60>
           ;;get output preferences
           (SETQ o_prefs (VLA-GET-OUTPUT prefs))
           ;;set default plot to file path
           (PRINC "\nCurrent Default Plot-to-File Path: ")
           (PRINC "\n")
           (PRINC (VLA-GET-DEFAULTPLOTTOFILEPATH o_prefs))
           (PRINC "\n")
           (PRINC)
           (IF (WCMATCH (STRCASE (GETVAR "dwgprefix")) "*\\810\\,*\\810 DESIGN DRAWINGS\\")
             (PROGN (DOS_MKDIR (STRCAT (GETVAR "dwgprefix") "Plots\\PDF\\"))
                    (VLA-PUT-DEFAULTPLOTTOFILEPATH o_prefs (STRCAT (GETVAR "dwgprefix") "Plots\\PDF\\"))
             ) ;_ end of PROGN
             (IF (WCMATCH (STRCASE (GETVAR "dwgprefix")) "*\\810\\*,*\\810 DESIGN DRAWINGS\\*")
               (PROGN (SETQ tif-path (GETVAR "dwgprefix"))
                      (WHILE (NOT (WCMATCH (STRCASE tif-path) "*\\810\\,*\\810 DESIGN DRAWINGS\\"))
                        (SETQ tif-path (SUBSTR tif-path 1 (1- (STRLEN tif-path))))
                      ) ;_ end of WHILE
                      (DOS_MKDIR (STRCAT tif-path "Plots\\PDF\\"))
                      (VLA-PUT-DEFAULTPLOTTOFILEPATH o_prefs (STRCAT tif-path "Plots\\PDF\\"))
               ) ;_ end of PROGN
               (PROGN (DOS_MKDIR (STRCAT (GETVAR "dwgprefix") "Plots\\PDF\\"))
                      (VLA-PUT-DEFAULTPLOTTOFILEPATH o_prefs (STRCAT (GETVAR "DWGPREFIX") "Plots\\PDF\\"))
               ) ;_ end of PROGN
             ) ;_ end of IF
           ) ;_ end of IF
           (PRINC "\nDefault Plot-to-File Path set to: ")
           (PRINC "\n")
           (PRINC (VLA-GET-DEFAULTPLOTTOFILEPATH o_prefs))
           (PRINC "\n")
           (IF debug-reactor
             (PROGN
               (PRINC "\nSETDEFPLOT: end (PROGN ...) ")
               (PRINC)
             )
           )
    ) ;_ end of PROGN
  ) ;_ end of IF
  (PRINC)
) ;_ end of DEFUN
;|«Visual LISP© Format Options»
(120 2 15 2 T "end of " 100 9 2 0 nil nil nil T T)
;*** DO NOT add text below the comment! ***|;

NOTE: The above code requires the attached LSP file which loads the appropriate version of DOSLIB, a free Visual Lisp/Autolisp library available from Robert McNeel & Associates.

 

AutoCAD User since 1989. Civil Engineering Professional since 1983
Product Version: 13.6.1963.0 Civil 3D 2024.4.1 Update Built on: U.202.0.0 AutoCAD 2024.1.6
                        27.0.37.14 Autodesk AutoCAD Map 3D 2024.0.1
                        8.6.52.0 AutoCAD Architecture 2024
0 Likes
Message 6 of 6

hencoop
Advisor
Advisor

@Kevin.Spear

 

Apparently, two things worked to fix the issue.  The second step is important, "Restart AutoCAD".

 

I regularly use PREVIEW to do a quick plot and I rarely remember to run my SETDEFPLOT command first (similar to the linked solution you provided).  That's the problem I wanted to fix and I could not yesterday... (at least not without restarting AutoCAD which I didn't even think about).  My approach:

  1. UNDEFINE the PREVIEW command and then redefine it via Autolisp. (preview.lsp is my redefinition).  For me, this is done in a user keyed lisp file that automatically loads my specific preferences (and this is just one preference).  Everyone here has one so they can preset/reset their preferences when they open a session.  The acaddoc.lsp file can perform these steps too but the contents of our acaddoc.lsp are the same for all users.
  2. RESTART AutoCAD!

I.E.:

 

    (COMMAND "undefine" "preview") ; undefines AutoCAD's PREVIEW command
    (SETQ c:preview nil) ; just for good measure
    (LOAD "preview" "\nFile PREVIEW.LSP not loaded! ")​ ; redefines the PREVIEW command

 

Now, when I issue the PREVIEW command (or PRE shortcut) the default plot to file path gets set to my specified project folder.  It would not do that yesterday.  Even though the lisp code was run and the definition changed, it would not execute SETDEFPLOT when I used PREVIEW.

 

Now, for this, my most frequent plotting method, the default plot to file path gets set first.

 

P.S. If any AutoCAD command gets undefined and its new definition doesn't work or you need AutoCAD's version of it, just put a period in front of the command name to invoke AutoCAD's internal definition.  I.e., .PREVIEW will always invoke AutoCAD's PREVIEW command whether it has been 'undefined' or not.  Command line entry is required (the COMMAND function in lisp will do it too).

AutoCAD User since 1989. Civil Engineering Professional since 1983
Product Version: 13.6.1963.0 Civil 3D 2024.4.1 Update Built on: U.202.0.0 AutoCAD 2024.1.6
                        27.0.37.14 Autodesk AutoCAD Map 3D 2024.0.1
                        8.6.52.0 AutoCAD Architecture 2024
0 Likes