Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

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

Set variable depending on location folder (find directory)

196 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: 344
Registered: ‎12-31-2009
Message 2 of 3 (168 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.

 

--

Member
thierry.huisman
Posts: 5
Registered: ‎02-29-2012
Message 3 of 3 (165 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
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!