Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Active Member
thierry.huisman
Posts: 8
Registered: ‎02-29-2012
Message 1 of 3 (199 Views)

Set variable depending on location folder (find directory)

199 Views, 2 Replies
09-20-2012 07:54 AM

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.

Valued Mentor
martti.halminen
Posts: 349
Registered: ‎12-31-2009
Message 2 of 3 (171 Views)

Re: Set variable depending on location folder (find directory)

09-21-2012 12:00 AM in reply to: thierry.huisman

Are you quite sure about your paths?

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

 

--

Active Member
thierry.huisman
Posts: 8
Registered: ‎02-29-2012
Message 3 of 3 (168 Views)

Re: Set variable depending on location folder (find directory)

09-21-2012 12:34 AM in reply to: martti.halminen

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

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.