acad1985 Posted July 20, 2018 Share Posted July 20, 2018 Hi Everyone, I have a Lisp file to Turnoff unwanted Layers. I want to run this lisp automatically, when i open the Drawing file. Actually in my office i don't have a access for C Drive, so that i can't add this into acaddoc.lsp. Please anyone help me out to do this. (defun c:unoff (/ layers) (command "._-layer" "_f" "*Electric*" "") (command "._-layer" "_off" "*Electric*" "") (princ) ) Thanks in advance Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted July 20, 2018 Share Posted July 20, 2018 Create an acaddoc.lsp file in the same directory as your drawings with the following content: (defun c:unoff nil (command "_.-layer" "_f" "*Electric*" "_off" "*Electric*" "") (princ) ) (if (= 'list (type s::startup)) (setq s::startup (append s::startup '((c:unoff)))) (defun-q s::startup nil (c:unoff)) ) (princ) Quote Link to comment Share on other sites More sharing options...
acad1985 Posted July 20, 2018 Author Share Posted July 20, 2018 Hello Lee, Thank you so much for your code. Its working Perfectly. But in my case, i have saved the drawing file to different folders/Path, so can i save this lisp file to one common folder and run from that folder? Or else we need to place create all the Drawing Directory? Please let me Know. Thanks Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted July 20, 2018 Share Posted July 20, 2018 If you can't access the content of existing support paths as you seem to imply from your first post, add a new trusted support path to your AutoCAD environment and save it there. Quote Link to comment Share on other sites More sharing options...
acad1985 Posted July 20, 2018 Author Share Posted July 20, 2018 I got it. Thank you so much Lee. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.