Retrieve value of Desktop Connector Cache location for each user as Variable

Retrieve value of Desktop Connector Cache location for each user as Variable

KPerison
Collaborator Collaborator
783 Views
5 Replies
Message 1 of 6

Retrieve value of Desktop Connector Cache location for each user as Variable

KPerison
Collaborator
Collaborator

I have a .CSV file that manages our title block attributes. A script file that runs LISP routing that reads those values, updates the title blocks, then plots the dwgs and places them into a defined folder location.

 

I had previously written the code to work with BIM30/ACC when the default location for the cache was your C:\.

C:\Users\username\ACCDocs\

With recent updates you have the option of changing your default "Workspace" location drive , root folder, etc

Now that the root location to that local cache is variable my routine will not work unless they left their install in the default location.

 

Is there a way to extract the DTC cache path as a variable? 

 

This is an example portion of the code I have atm.

(load (strcat "C:\\Users\\" (getenv "username") "\\ACCDocs\\......blahblah......\\UpdateTBAttributes.lsp"))

 

If for example someone modifies their DTC workspace to say D drive and a Subfolder that path would be like this:

D:\Users\username\DC\ACCDocs\.....blahblah.....\UpdateTBAttributes.lsp

 

How would you extract the red text as a variable??

Pls/Thx.

0 Likes
Accepted solutions (1)
784 Views
5 Replies
Replies (5)
Message 2 of 6

marko_ribar
Advisor
Advisor
(setq path (strcat (getenv "HOMEDRIVE") (getenv "HOMEPATH")))
"C:\\Users\\Korisnik"

 

Marko Ribar, d.i.a. (graduated engineer of architecture)
0 Likes
Message 3 of 6

KPerison
Collaborator
Collaborator

Thanks, I've used those variables before as well, but....

 

When I enter that code it returns:

"C:\\Users\\kperison"

 

The workspace drive and folder I have set is:

D:\Users\kperison\DC

 

So, it is not pulling the DTC workspace location. Just the Windows user settings.

 

 

 

0 Likes
Message 4 of 6

trevor.bird.au
Advocate
Advocate
Accepted solution

Hi Kelly,

 

Please try the following which is based on Desktop Connector version 16.2.1.2016 being installed.

 

(vl-registry-read "HKEY_CURRENT_USER\\SOFTWARE\\Autodesk\\Autodesk Drive" "Workspaces")

 

This will return a list e.g. (7 "%userprofile%\DC\ACCDocs")

From Autodesk which I assume is the default workspace location:

Your new v16 local workspace location will be %userprofile%\DC\ACCDocs

 

The registry key type is 'REG_MULTI_SZ' which indicates that a list of folders can be set however I haven't seen any Autodesk documentation that explains why this is so.

 

 

(cadr (vl-registry-read "HKEY_CURRENT_USER\\SOFTWARE\\Autodesk\\Autodesk Drive" "Workspaces"))

 

This will return the folder e.g. "%userprofile%\DC\ACCDocs"

 

Regards,

Trevor

 

0 Likes
Message 5 of 6

KPerison
Collaborator
Collaborator
Fantastic. That's exactly it. Thank you so much.
0 Likes
Message 6 of 6

KPerison
Collaborator
Collaborator

Just a quick follow-up for anyone wandering onto the scene afterward.

Seems the installation of Desktop Connector is a wee-bit random.  I'll explain.

When the installation occurs, 2 drives are installed ACCDocs (Docs) and ADrive (Autodesk Drive).

In the registry, those workspace locations are recorded under a Multi-String Reg variable thus both path locations are recorded in the same variable.

What I've discovered is that depending on the Time of day and barometric pressure those 2 paths can swap order in the REG variable when installing.

How do I know this - working on projects btwn 15.8 and 16.3 = Constant uninstall/Install cycles. Fun!

 

So, if you are trying to pull the ACCDocs workspace path you may need to re-order the path listing in the variable.

Once I re-ordered the path listing my routines started working once again.

KPerison_0-1690253400350.png

Edited the registry and moved the ACCDocs path to the top of the list.

 

0 Likes