
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi guys
No matter how many (princ) I place in this code, I always get an error message after processing this lisp routine, although the saving process is successful:
"Saving was successful.; Fehler: no function definition: nil"
(Fehler is German for Error.)
Does anyone see the reason why this is happening? I'm new to LISP/AutoCAD and started writing my own codes last week.
So far I managed to let the users switch between one Standard-Profile (with syncing tool palettes and tool palette groups) and their own personal profile.
This is one part of the code which allows the profile managers only to save the profiles (so that the groups of the tool palettes can be imported by a button click.)
Thanks in advance.
Cheers
(defun C:savestandardprofile () (setq loginname (getvar 'loginname)) (setq msgsps1 "Saving was successful.") (setq msgsps2 "No access!") (setq msgsps3 "The profile is not active!") ;;With the IF-Function I check if the Standard-Profile is active. If it is, I allow saving. If it's not, I get a prompt (msgsp3). (if (= (getvar "cprofile") "Sample Standard Profile") ;;Only 2 users of our team are allowed to apply changes to the Standard-Profile and save it. With the cond I only allow these 2 users to save. If it's another user, they will get the msgsp2 message. (cond ((= loginname (strcat "USER1")) ( (vla-exportprofile (vla-get-profiles (vla-get-preferences (vlax-get-acad-object))) "Sample Standard Profile" (strcat "Y:\\ACAD_GLOBAL\\2018\\Profile\\Sample Standard Profile.arg")) (prompt msgsps1) (princ) ) ) ((= loginname (strcat "USER2")) ( (vla-exportprofile (vla-get-profiles (vla-get-preferences (vlax-get-acad-object))) "Sample Standard Profile" (strcat "Y:\\ACAD_GLOBAL\\2018\\Profile\\Sample Standard Profile.arg")) (prompt msgsps1) (princ) ) ) (t (prompt msgsps2) (princ) ) );cond ( (prompt msgsps3) (princ) ) );If (princ) );defun
Solved! Go to Solution.