Trying to load an init.lsp from a network using ACADDOC.lsp

Trying to load an init.lsp from a network using ACADDOC.lsp

Anonymous
Not applicable
1,419 Views
10 Replies
Message 1 of 11

Trying to load an init.lsp from a network using ACADDOC.lsp

Anonymous
Not applicable

Hello. 

I'm trying to load an init.lsp file that is located on a network for 30+ CAD users using an ACADDOC.lsp, located in the local support folders. 

The idea is to have each user place the ACADDOC.lsp file in their C:\Users\user\AppData\Roaming\Autodesk\AutoCAD 2021\R24.0\enu\Support which will load the init.lsp file located on our server:  X:\CAD Management\NCS21\SUPPORT

The init.lsp is meant to change support file paths and system variables.  I would like to be able to edit one file without having to reload settings for each user individually.  

The code in the ACADDOC.lsp is as follows:

(setq lisp_path “X:\\CAD Management\\NCS21\\SUPPORT”)
(if (findfile (strcat lisp_path "init.lsp"))
(load (strcat lisp_path "init.lsp"))
)

When starting AutoCAD it seems to find the ACADDOC.lsp file, but is not loading the init.lsp.

Any help and suggestions would be appreciated.

0 Likes
Accepted solutions (1)
1,420 Views
10 Replies
Replies (10)
Message 2 of 11

CodeDing
Advisor
Advisor

@Anonymous ,

 

Looks like you're forgetting a slash in there:

(setq lisp_path “X:\\CAD Management\\NCS21\\SUPPORT\\”)
(if (findfile (strcat lisp_path "init.lsp"))
  (load (strcat lisp_path "init.lsp"))
)

Give that a try. best,

~DD

Message 3 of 11

Anonymous
Not applicable

Good suggestion, but still doesn't seem to load the init.lsp

0 Likes
Message 4 of 11

CodeDing
Advisor
Advisor

@Anonymous ,

 

Run this in your command line and tell me what it returns please..

(findfile "X:\\CAD Management\\NCS21\\SUPPORT\\init.lsp")
0 Likes
Message 5 of 11

Anonymous
Not applicable

Here you are, Sir

Command: (findfile "X:\\CAD Management\\NCS21\\SUPPORT\\init.lsp")
"X:\\CAD Management\\NCS21\\SUPPORT\\init.lsp"

0 Likes
Message 6 of 11

cadffm
Consultant
Consultant

Is it a trusted path location?

 

Sebastian

0 Likes
Message 7 of 11

Anonymous
Not applicable

Yes, I've added X:\CAD Management\ to the trusted locations.

0 Likes
Message 8 of 11

Kent1Cooper
Consultant
Consultant
Accepted solution

@Anonymous wrote:

....

(setq lisp_path “X:\\CAD Management\\NCS21\\SUPPORT”)
....

.....


Those are "smart quotes" such as come from word processors, not from plain-text editors.  Change them in your acaddoc.lsp file to "dumb" or "plain" quotation marks that look the same at both ends of the string, as in the suggested test in Message 5.

Kent Cooper, AIA
Message 9 of 11

Anonymous
Not applicable

Ah ha!  That's it!  I knew it was going to be something small like that.  

Thank you both for the help!

0 Likes
Message 10 of 11

CodeDing
Advisor
Advisor

@Anonymous ,

 

I believe Kent hit the nail on the head. Here, you can copy this if necessary. 

The returned string that you provided after running (findfile ...) tells me that the file exists and the path is correct. Your small piece of code should now work.

 

If it's NOT working after this, then it is something else that is causing your problem.

 

(setq lisp_path "X:\\CAD Management\\NCS21\\SUPPORT\\")
(if (findfile (strcat lisp_path "init.lsp"))
  (load (strcat lisp_path "init.lsp"))
)

 

--EDIT--

Btw, great eye Kent. Good catch. I never would have seen that. Not a common issue to run into.

 

Best,

~DD

0 Likes
Message 11 of 11

Sea-Haven
Mentor
Mentor

Rather than add a acaddoc.lsp why not just use Appload and add your init.lsp to "startup suite" a simple method of forcing a load, used for years with server very successfully, so if update init.lsp end user gets latest, same with custom menus always saved on server so if updated end user would get updated version on next start up.

screenshot275.png

0 Likes