Code Red => AutoLISP (Vanilla / Visual) => Topic started by: MSTG007 on June 27, 2022, 11:25:28 AM
Title: Can a user have a custom preference saved?
Post by: MSTG007 on June 27, 2022, 11:25:28 AM
Maybe the question is to vague, I have some users that want there "startup" to be on a certain layer. (For Example. Layer 0 set to C-NPLT (no plot) Layer).
I know I could write a routine that I could load in each users startup. But there are alot of users.
Would there be a method to have a user activate this command to turn it on. And then if the user would want to turn it off.
(command "-layer" "set" "C-NPLT" "") Once, the command is turned on, it would always be on for each session of AutoCAD until the user decides to turn it off?
Sorry for rambling on. Thank you for any ideas on this one.
Title: Re: Can a user have a custom preference saved?
Post by: mhupp on June 27, 2022, 11:53:21 AM
Command: (setq a (hook '(+ 1 2))) ((LAMBDA nil (+ 1 2))) Command: (eval a) 3 Command: (setq a (hook (cons '- (cdr (car (cddr (car a))))))) ((LAMBDA nil (- 1 2))) Command: (eval a) -1 ...but you can achieve something very, very similar with no support routines (and probably far better too) --i.e. `hook`-- with defun-q so I've never taking it further then what you see here.
Title: Re: Can a user have a custom preference saved?
Post by: danAllen on June 27, 2022, 05:02:22 PM
I created a routine to load a users lisp file from network folder. The office standard lisps would look for a file called xyz_user.lsp, in a folder named for (getvar "LOGINNAME") under a common staff folder on network (..\\staff\\Dan), and load it if found.