set WORKINGFOLDER

set WORKINGFOLDER

paullimapa
Mentor Mentor
2,118 Views
10 Replies
Message 1 of 11

set WORKINGFOLDER

paullimapa
Mentor
Mentor

AutoCAD 2016 introduced read only sys var: WORKINGFOLDER 

Each session of AutoCAD can only have one WORKINGFOLDER sys var.

This is different than an opened drawing's path location read only sys var: DWGPREFIX

Since there can be multiple drawing's opened from different folder path locations, there can be various dwgprefix in a single AutoCAD session.

Express Tools can change the WORKINGFOLDER location using function: (acet-file-chdir directory)

Is there a way to do this with plain old Vlisp?

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Accepted solutions (1)
2,119 Views
10 Replies
Replies (10)
Message 2 of 11

john.uhden
Mentor
Mentor

@paullimapa 

Looks like you found your own answer... (acet-file-chdir directory).

Go ahead an accept yourself. 😊

John F. Uhden

0 Likes
Message 3 of 11

paullimapa
Mentor
Mentor

I would like to further ask how’s this Workingfolder read only sys var set initially before AutoCAD is launched?


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 4 of 11

john.uhden
Mentor
Mentor

@paullimapa 

Just by casual inspection, it appears to be set to the the folder of the first drawing opened in the current AutoCAD session, even if it has been closed, or something like that.  Mine is currently set to a drawing I was working on earlier but that is now closed.

Haven't tried that acet thingy, but you should and let us know how it worked.

What difference does it make?  If you were going to write some text file associated with your current drawing, wouldn't you just use the dwgprefix?

John F. Uhden

Message 5 of 11

paullimapa
Mentor
Mentor

just discovered as you recommended with further experimentation that the WORKINGFOLDER changes but not on every instance of opening a drawing. For me it usually skips a drawing and then the WORKINGFOLDER would change to match with the dwgprefix of the drawing before. That's just very strange and unstable behaviour.


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 6 of 11

john.uhden
Mentor
Mentor
Accepted solution

@paullimapa 

And we will NOT deal with strange and unstable behaviour.

John F. Uhden

0 Likes
Message 7 of 11

Kurt_Van_de_Steene
Explorer
Explorer

Once you know how this stuff works... It's actually not that strange. And you will see that it behaves very stable.

Here is what I can tell about WORKINGFOLDER:

 

  1. WORKINGFOLDER has the same value as the "Start In" value that is specified in the properties of the shortcut that started AutoCAD

  2. Starting AutoCAD by double clicking on a drawing will set WORKINGFOLDER (for that ACAD-session) to the path of the first DWG that you have opened that way.

  3. You can also start AutoCAD with a self-made Shortcut. And if the "Start in" value in your AutoCAD shortcut is made blank, then the WORKINGFOLDER value will be the path of the folder that contains that AutoCAD shortcut. (BTW in my opinion, this provides is a very neat solution to set the WORKINGFOLDER location by simply putting such a "blank Start in" shortcut in any FOLDER where you want to run various batch-jobs with AutoCAD / In you want to try this DIY Shortcut-approach, you should also checkout the ACAD.EXE Command line parameters)

  4. If you prefer, then you can also set a fixed path in the "Start in" of your Self-made Shortcut. That way the WORKINGFOLDER will always be that same path, whenever you start your ACAD.EXE from that shortcut.


     
0 Likes
Message 8 of 11

scot-65
Advisor
Advisor

@paullimapa 

 

Well, darn, that's why.

I have been beating my head trying to preset to no avail the destination directory for the PLOT and PUBLISH commands using a reactor but have had no luck when there are multiple drawings from multiple directories that are open in a single editor. Also this WORKINGFOLDER value seems to be retained when all drawings are closed and only the editor is open. Sure, the PLOT and PUBLISH paths are retained when manually navigating to these locations via these commands, but this is the only way to change (reset) the destination plot/publish directory.

 

It seems the registry key "Location" for the PUBLISH is a read only type as I have changed this thru the reactor but it did not apply when command PUBLISH.

 

We here do not have any ACET functions (AutoCAD LT) and I too would welcome an answer.

 


Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.

0 Likes
Message 9 of 11

BlackBox_
Advisor
Advisor

@paullimapa I know this is an old topic for you, so if it's no longer relevant, please disregard. 

 

Just curious if you could help us understand why you're wanting to change WORKINGFOLDER?

 

Cheers

 


"How we think determines what we do, and what we do determines what we get."

Chris (BlackBox) Bradley
Managing Partner / Developer / Civil Designer
Quux Software | Sincpac C3D | Style Explorer

0 Likes
Message 10 of 11

paullimapa
Mentor
Mentor

Unfortunately I don’t recall why I wanted to have this option using vlisp. 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 11 of 11

BlackBox_
Advisor
Advisor

No worries; *IF* this comes up again, Autoloader makes it incredibly easy to spin up custom sysvars.

 

HTH


"How we think determines what we do, and what we do determines what we get."

Chris (BlackBox) Bradley
Managing Partner / Developer / Civil Designer
Quux Software | Sincpac C3D | Style Explorer

0 Likes