Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Set variable depending on location folder (find directory)

2 REPLIES 2
Reply
Message 1 of 3
thierry.huisman
446 Views, 2 Replies

Set variable depending on location folder (find directory)

We have user folders on severall servers, now I want the user menu's to be stored on the network so their home folder depends on what server it's located on. I tried using the vl-file-directory-p command but it doesn't seem to work.

Even worse, as soon as the userfolder is found I want to let the script check for a file called user.cuix in the Acad folder and if it doesn't excists copy it from another location to that folder (if possible).

This is what I got so far:

 

(setq UserName (getvar "loginname"))
(setq RootZW "\\\\users\\zw\\")
(setq RootVL "\\\\users\\vl\\")

(setq Company "\\\\CADConf\\ACAD13\\")

 

(if (vl-file-directory-p (strcat RootZW UserName))
 (progn
  (setq AcadMap (strcat RootZW UserName "\\acad\\")
 )
)
(if (vl-file-directory-p (strcat RootVL UserName))
 (progn
  (setq AcadMap (strcat RootVL UserName "\\acad\\")
 )
)

 

(setenv "MenuFile" (strcat AcadMap "user.cuix"))

 

 

Next to this we have 4 other options as well, but to keep it short I left it at the first 2.

2 REPLIES 2
Message 2 of 3

Are you quite sure about your paths?

Seems to me you have RootVL and RootZW both pointing to the same server.

 

--

Message 3 of 3

Difference is in the folder (one is ZW other is VL). We also have an entirely different server as well

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost