GregGleason 发表于 2022-7-5 13:07:25

acaddoc.lsp - Question

Will the acaddoc.lsp run in any folder, or just in folders defined in the search path.  My assumption from reading the documentation is that it does not need to be defined in the search path.  The only requisite is the acaddoc.lsp file and the .dwg file need to be in the same folder. 
       
        The reason that I ask is that on AutoCAD 2018 does not run acaddoc.lsp like the earlier versions did (2014 & 2016).
       
        Can anyone confirm or correct this?
       
        Greg

ronjonp 发表于 2022-7-5 13:20:08

It might be due to the security settings Autodesk has been adding ( TRUSTEDPATHS, SECURELOAD etc. )

BIGAL 发表于 2022-7-5 13:23:32

The support paths are checked first and if I remember right once it finds one it stops searching.

rkmcswain 发表于 2022-7-5 13:35:45

I have to admit, I was skeptical when I read your post. Things rarely change with AutoCAD/Autolisp over the years, or at least I would have thought I would have remembered this.
        But after some testing, I agree.
        Given an "acaddoc.lsp" file in the drawing folder, in AutoCAD 2016 and lower, it does get loaded, regardless of the existence of any other "Acaddoc.lsp" file. Presumably because AutoCAD is considering the drawing folder at the TOP of the support file search path.
         
        On 2017 and later, it does not load the "Acaddoc.lsp" file from the drawing folder. It loads the first one it finds in the Support File Search Path (presuming there is another one). This makes me think it's no longer considering the DWG folder to be at the top of the support file search path.
         
        An old trick is to run the -INSERT command (note the hyphen), and then enter a bogus string (EXAMPLE: "gsdfg543casdfas" ) for the block you want to insert. AutoCAD will respond with a message dialog stating that it can't find "gsdfg543casdfas" in the search path, and then list all of the search paths. The listing of the search paths has not changed in 2017 and later however. It still shows the DWG folder as second in the list, right above the "Support File Search Path" that you see in OPTIONS.
         
        Looks like you found a bug, unless you can find some documentation on this changed behavior. I know who to ask. I'll report back if I find out something.

GregGleason 发表于 2022-7-5 13:44:02

Thank you, rkmcswain, for taking an interest in this issue and appreciate the information if something is known.  I have been scratching my head a few days about it.
         
        Greg

BIGAL 发表于 2022-7-5 13:45:14

Call your acaddoc autoload.lsp and try interested to know, we use this name for our library lisp so never change acaddoc.lsp

Roy_043 发表于 2022-7-5 13:55:28

This is not a bug and ronjonp is correct in mentioning the TRUSTEDPATHS variable.
        Further reading:
        https://knowledge.autodesk.com/support/autocad/learn-explore/caas/sfdcarticles/sfdcarticles/AutoCAD-and-Viruses.html

GregGleason 发表于 2022-7-5 14:01:38

I took up the issue with my reseller and he forwarded it to Autodesk when he was able to replicate it with AutoCAD 2017 and a fully patched install of 2018.
         
        The answer came back pretty quickly and they were simple fixes:
       
        LEGACYCODESEARCH set that to ON
        SECURELOAD set that to 0
         
        Once I set those then all was golden again.
         
        Thank you for all the comments.
         
        Greg

Lee Mac 发表于 2022-7-5 14:08:24

With a little reading, you could have saved you & your reseller some time -
         
         
        You can lead a horse to water...
         
页: [1]
查看完整版本: acaddoc.lsp - Question