Discussion:
AcadDoc.lsp
(too old to reply)
Sandra Rivera
2004-09-29 16:29:00 UTC
Permalink
Can anyone tell me under what circumstances Autocad will NOT load the
AcadDoc.lsp file automatically when a new drawing is opened? The file is in
the directory where the drawing is. After the drawing opens I can type
(load "ACADDOC.LSP") and it loads as it should.
fengk
2004-09-29 17:35:54 UTC
Permalink
my understanding is you won't need to use "load" to load acaddoc.lsp. It should be automatically loaded. are you just using vanilla autocad?
T.Willey
2004-09-29 17:37:43 UTC
Permalink
I think so also, but the file "acaddoc.lsp" has to be in a acad search path.

Tim
dblaha
2004-09-29 17:45:39 UTC
Permalink
Actually, having the acaddoc.lsp in the same folder as the file will work wether or not that folder is defined in the acad search path. In fact, it will override any other acaddoc.lsp in AutoCAD's search path when a file in that folder is opened since the "current" folder is always the first place AutoCAD looks in it's search process. Personally, I always have the acaddoc.lsp in a specific network location for all my users. But perhaps Sandra has a specific reason for needing to have it in the same folder as the drawing?


Dave
SpeedCAD
2004-09-29 17:48:39 UTC
Permalink
Hi...

Use the acad2000doc.lsp file
Tom Smith
2004-09-29 17:56:53 UTC
Permalink
No! Bad practice, highly unadvisable. That's their file. Put your stuff in
your file.
Sandra Rivera
2004-09-29 18:17:56 UTC
Permalink
Thank you for the workaround. I copied the AcadDoc2004.lsp as is into the
directory where it needed to be and added my load function for the
AcadDoc.lsp at the bottom. That way these particular programs will load
only when a drawing in that directory is opened.

I am still curious as to why Autocad doesn't do what it is documented that
it will do.
Post by SpeedCAD
Hi...
Use the acad2000doc.lsp file
SpeedCAD
2004-09-29 18:21:17 UTC
Permalink
Hi...

What do you want do????. Do you talk spanish???. Me yes :D...

No entiendo lo que deseas hacer.

Un saludo de SpeedCAD... :D
CHILE
FORO: http:///www.hispacad.com/foro
Luis Esquivel
2004-09-29 18:33:37 UTC
Permalink
appears to be that the acaddoc.lsp is not loaded for some reason... it may
not exist or is on a different place...

Sandra.... what do you read on the command: (findfile "acaddoc.lsp") ?

and the acad2004doc.lsp is a reserved file for autocad.... read the warning
about this on the help file....
Sandra Rivera
2004-09-29 19:09:31 UTC
Permalink
The file should be loading automatically. It is not.
Typing (findfile "acaddoc.lsp") returns the correct path and filename.
Typing (load "acaddoc.lsp") with no pathname works. I get the prompts
showing that the program is loading as it should.
Autocad loads the Acaddoc2004 file even after it is copied to the drawing
directory. That file is unchanged except for the (load "acaddoc.lsp") at
the bottom. As in the warnings, I hate to do that but is there another
alternative?
Post by Luis Esquivel
appears to be that the acaddoc.lsp is not loaded for some reason... it may
not exist or is on a different place...
Sandra.... what do you read on the command: (findfile "acaddoc.lsp") ?
and the acad2004doc.lsp is a reserved file for autocad.... read the warning
about this on the help file....
Luis Esquivel
2004-09-29 19:14:04 UTC
Permalink
see my previous post... or simple place the same line you did on acad.mnl or
within your own xxx.mnl

hth
Post by Sandra Rivera
the bottom. As in the warnings, I hate to do that but is there another
alternative?
Tom Smith
2004-09-29 18:36:03 UTC
Permalink
Post by Sandra Rivera
I am still curious as to why Autocad doesn't do what it is documented that
it will do.

It should. I can't reproduce that behavior. If an acaddoc.lsp exists in the
drawing folder, it alway loads for me, and supercedes any other acaddoc.lsp,
because the drawing folder is always first on the search path. So as far as
I can tell, Acad 2004 and prior versions do exactly what they're supposed to
do.

I suspect that something else is broken, or getting in the way. Hacking the
acad2004doc.lsp isn't the best workaround, and I'd advise finding a
different way to do things if possible.
Luis Esquivel
2004-09-29 18:56:11 UTC
Permalink
You may try to force the loading by pasting this on any mnl file [ie
acad.mnl] just to test or make sure the file is there....

(if (findfile (strcat (getvar "dwgprefix") "acaddoc.lsp"))
(load (findfile (strcat (getvar "dwgprefix") "acaddoc.lsp"))
nil))
Sandra Rivera
2004-09-29 21:24:53 UTC
Permalink
Thank you, you have been a big help.
Post by Luis Esquivel
You may try to force the loading by pasting this on any mnl file [ie
acad.mnl] just to test or make sure the file is there....
(if (findfile (strcat (getvar "dwgprefix") "acaddoc.lsp"))
(load (findfile (strcat (getvar "dwgprefix") "acaddoc.lsp"))
nil))
Arnold Williams
2004-10-01 14:22:05 UTC
Permalink
Sandra,

Been sort of following this with some interest and hoping for a logical
solution. But anyway I have one theory to try. What is your
REMEMBERFOLDERS system variable set to? If it is set to 1 then try setting
it to 0 and test the behavior of your setup again if you can... but without
Luis' code in it. The Help files provide this information on the
REMEMBERFOLDERS variable (from AutoCAD Building Systems 2005).

Type: Integer
Saved in: Registry
Initial value: 1

Controls the default path for the Look In or Save In option in standard file
selection dialog boxes.


0 Restores the behavior of AutoCAD 2000 and previous releases. When you
start AutoCAD by double-clicking an AutoCAD icon, if a Start In path is
specified for the icon, that path is used as the default for all standard
file selection dialog boxes.

1 Specifies that the default path in each standard file selection dialog box
is the last path used in that dialog box. The Start In folder specified for
the AutoCAD icon is not used.



So then, I can imagine that this may affect whether or not AutoCAD can find
and load your acaddoc.lsp file. It probably also depends on what method you
use to initialize AutoCAD and then open your files and any subsequent files.
Sounds to me if REMEMBERFOLDERS is set to 1 and then you open a second file
by scrolling to a different folder, which has a different acaddoc.lsp file
in it, and opening a file (that is not in your current folder which already
has its own acaddoc.lsp file - follow all that?) then this odd behavior
manifests itself. There may be a situation that does not update the path
information that the variable is affecting. I am just speculating, I don't
know all of your settings or how you are opening files and subsequent files
or all the situations that affect the REMEMBERFOLDERS variable. And I am
not sure if this variable is the cause of this situation. And I did not try
to test this theory.

Hopefully, this will lead to an answer, let us know if you tested any of
this please.

Arnold Williams
Post by Sandra Rivera
Thank you, you have been a big help.
Post by Luis Esquivel
You may try to force the loading by pasting this on any mnl file [ie
acad.mnl] just to test or make sure the file is there....
(if (findfile (strcat (getvar "dwgprefix") "acaddoc.lsp"))
(load (findfile (strcat (getvar "dwgprefix") "acaddoc.lsp"))
nil))
Loading...