@john.uhden
This discussion is for command PUBLISH.
I use a session gremlin to store the specific destination directory path for that file.
I checked and the gremlin is "sand-boxed".
Setting the path at startup will not work where there are multiple drawings opened in the editor. The last opened file wins.
As you may know the registry has just one key for this value. And SDI is now permanently disabled.
One can also store the path in a dictionary object but one additional key *might be* needed to compare the current file's name to that which is stored (or other methods of identifying the file). Rewrite as required (project started life as a template).
Reactor commandwillstart:
1. Build your default path here if does not exist and store as a session gremlin.
(or USER_PUBLISH (setq USER_PUBLISH ... ))
2. You mentioned the destination directory may not exist. This is the place to test for and build if missing.
3. Set the path in the registry.
...\Profiles\<<Unnamed Profile>>\Dialogs\AcPublishDlg
(vl-registry-write ... "Location" USER_PUBLISH)
Reactor commandended:
1. Fetch the actual path that was used and store as the session gremlin [/dictionary object].
(setq USER_PUBLISH (vl-registry-read ... "Location"))
We start in the root directory of the project and let the user navigate to the "\PDF Files\Review Sets" or other sub-directories to the \PDF Files\ root directory as required. Once the command completed, the next time PUBLISH is called, the Location is set.
Command PLOT is similar - USER_PLOT
Command WBLOCK is also in my arsenal but does not have a session gremlin (set the registry key to getvar dwgprefix).
Hope this helps.
Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.