vnanhvu Posted May 24, 2011 Posted May 24, 2011 I HAVE SOME LISP. I INPUT ALL IN 1 FILE LISP. SOME COMMAND SOMETIMES I USE, I DONT REMEMBER IT. CAN YOU HELP ME, CREAT A LISP DISPLAY MENU OF ALL COMMAND! THANKS FOR ALL ! :wink: Quote
ReMark Posted May 24, 2011 Posted May 24, 2011 You are looking for a lisp routine that will read this one "master" lisp file and tell you the name of all the lisp routines contained in the file? Quote
vnanhvu Posted May 24, 2011 Author Posted May 24, 2011 you are looking for a lisp routine that will read this one "master" lisp file and tell you the name of all the lisp routines contained in the file? exp.: I have 3command: Defun:cb..... Defun:cd...defun:ce. I write notes: Cb: For change point insert block, cd: For change dim style, ce:....etc.... The lisp will display content notes! Quote
vnanhvu Posted May 24, 2011 Author Posted May 24, 2011 http://lee-mac.com/getsyntax.html hi lee! Getsuntax good! But i will notes attached with command ! Can you help me ! Thank you very much ! Quote
Lee Mac Posted May 24, 2011 Posted May 24, 2011 I write notes: Cb: For change point insert block, cd: For change dim style, ce:....etc....The lisp will display content notes! Are the notes in a separate file? If so, this will merely print the contents to the command line: (defun c:notes ( / file line ) [color=red] (setq file "C:\\MyNotes.txt") ;; Filename of Notes file[/color] (cond ( (not (setq file (findfile file))) (princ "\n--> Notes File not Found.") ) ( (not (setq file (open file "r"))) (princ "\n--> Error Opening File.") ) (t (while (setq line (read-line file)) (terpri) (princ line)) (setq file (close file)) (textscr) ) ) (princ) ) Alternatively, you could just open the file: (defun c:notes2 ( / file ) [color=red] (setq file "C:\\MyNotes.txt") ;; Filename of Notes file[/color] (if (setq file (findfile file)) (startapp "notepad" file) (princ "\n--> Notes File not Found.") ) (princ) ) In both cases, change the parts marked in red to suit your filename. Quote
vnanhvu Posted May 24, 2011 Author Posted May 24, 2011 You help me please one more question! Txt file furthermore, you can show other file type. Example .vlx, fas ... Quote
Lee Mac Posted May 24, 2011 Posted May 24, 2011 Txt file furthermore, you can show other file type. Example .vlx, fas ... No, they are protected files. Quote
vnanhvu Posted May 24, 2011 Author Posted May 24, 2011 Is there any way to transfer files .VLX, FAS TO .LSP ! DID YOU KNOW, LEE ? Quote
Lee Mac Posted May 24, 2011 Posted May 24, 2011 Is there any way to transfer files .VLX, FAS TO .LSP ! DID YOU KNOW, LEE ? No. The author of a VLX has protected its contents for a reason. Quote
vnanhvu Posted May 24, 2011 Author Posted May 24, 2011 HI LEE ! I TEST WITH YOUR LISP ! WHEN CHANGE (setq file "C: \ \ MyNotes.txt");; Tên file của các tập tin ghi chú >>> (setq file "C:Program Files\Autodesk\ \ MyNotes.txt");; Tên file của các tập tin ghi chú , LISP NO SHOW FILE ! WHY, LEE ! IF CHANGE WITH (setq file "D: \ \ MyNotes.txt");; Tên file của các tập tin ghi chú.... LISP GOOD ! I DO NOT UNDERSTAND WHY. Quote
vnanhvu Posted May 24, 2011 Author Posted May 24, 2011 (setq file "C: Program Files\Autodesk\ \ MyNotes.txt");; Tên file của các tập tin ghi chú , I Used double-backslashes in my filename. hix ! Quote
Lee Mac Posted May 24, 2011 Posted May 24, 2011 (setq file "C: Program Files\Autodesk\ \ MyNotes.txt");; Tên file của các tập tin ghi chú , I Used double-backslashes in your filename. hix ! No you didn't, there is no double-backslash after C: or between Program Files and Autodesk. Don't put code through a translator. Quote
vnanhvu Posted May 24, 2011 Author Posted May 24, 2011 No you didn't, there is no double-backslash after C: or between Program Files and Autodesk. Don't put code through a translator. yeah ! I FIXED IT ! THANKS LEE MUCH MUCH ! Quote
vnanhvu Posted May 24, 2011 Author Posted May 24, 2011 WHEN I USE THIS LISP! APPEARS "AUTOCAD TEXT WINDOW", IT SHOW VERY LONG. I can shorten DISPLAY OF " AUTOCAD TEXT WINDOW " ? Hopefully HELP FROM YOU ! Quote
vnanhvu Posted May 24, 2011 Author Posted May 24, 2011 Press F2 to toggle the display of the window. Maybe you do not understand me. i do with 100 commands, but I just want to display the five most recent commands. Quote
Lee Mac Posted May 24, 2011 Posted May 24, 2011 (defun c:notes ( / file line n ) (setq file "C:\\MyNotes.txt") ;; Filename of Notes file (setq n 5) ;; Number of lines (cond ( (not (setq file (findfile file))) (princ "\n--> Notes File not Found.") ) ( (not (setq file (open file "r"))) (princ "\n--> Error Opening File.") ) (t (while (and (setq line (read-line file)) (<= 0 (setq n (1- n)))) (terpri) (princ line)) (setq file (close file)) (textscr) ) ) (princ) ) Quote
vnanhvu Posted May 24, 2011 Author Posted May 24, 2011 (defun c:notes ( / file line n ) (setq file "C:\\MyNotes.txt") ;; Filename of Notes file (setq n 5) ;; Number of lines (cond ( (not (setq file (findfile file))) (princ "\n--> Notes File not Found.") ) ( (not (setq file (open file "r"))) (princ "\n--> Error Opening File.") ) (t (while (and (setq line (read-line file)) (<= 0 (setq n (1- n)))) (terpri) (princ line)) (setq file (close file)) (textscr) ) ) (princ) ) HIX ! I HAVE TO EXPRESS HOW TO UNDERSTAND YOU. I USE 10 COMMANDS: LINE,SPLINE,TRIM,EXTEND,ROTATE,REC,CIRCLE,PLINE,NOTES,HATCH. NEXT I USE A LISP FOR WHEN I PRESS F2, IT DISPLAY 5 COMMANDS LASTEST ( REC,CIRCLE,PLINE,NOTES,HATCH ). Hopefully YOU WILL UNDERSTAND ME ! THANK YOU AGAIN Quote
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.