PDA

View Full Version : Load Profile w/ Lisp



bjrams
10th May 2005, 09:04 pm
Trying to use this code to load profiles on startup of new user.
The first part works fine, but loading the profiles, seems the function to sample-profile-import doesn't work, and I'm guessing the sample-profile-set-active will not either.
May I get some assistance with figuring this one out, I'd appreciate it.


(defun-q S::STARTUP ()

;;force standard profiles function
;=================================
(setq flagfile (strcat "c:\\" (getenv "username") ".txt")) ;;set user's name of marker file
(if (not (findfile flagfile))
(progn (setq fi (open flagfile "w")) ;;file doesn't exist, so write the marker file & import profile
(setq fi (close fi))
(if (not (vl-bb-ref ':sample-imported-profile)) ;; have we imported the profile yet?
(progn
(vl-bb-set ':sample-imported-profile T)
(sample-profile-import "c:\\My_Profile.arg" "My_Profile" T)
(sample-profile-set-active "My_Profile")
)
)
)
)
(princ)
) ;end s::startup

bjrams
10th May 2005, 09:04 pm
Sorry about that, using AutoCad 2004 and Windows XP SP2

CAB
12th May 2005, 01:22 pm
The code you posted is incomplete.
It relies on user created functions 'sample-profile-import and 'sample-profile-set-active
the ':sample-imported-profile is a variable placed on the blackboard.
You need to locate the functions.