Jump to content

Recommended Posts

Posted

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:

  • Replies 21
  • Created
  • Last Reply

Top Posters In This Topic

  • vnanhvu

    11

  • Lee Mac

    9

  • ReMark

    1

  • Organic

    1

Top Posters In This Topic

Posted

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?

Posted
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!

Posted
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.

Posted

You help me please one more question!

Txt file furthermore, you can show other file type. Example .vlx, fas ...

Posted
Txt file furthermore, you can show other file type. Example .vlx, fas ...

 

No, they are protected files.

Posted

Is there any way to transfer files .VLX, FAS TO .LSP ! DID YOU KNOW, LEE ?

Posted
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.

Posted

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.

Posted

(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 !

Posted
(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.

Posted
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 !:)

Posted

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 !

Posted
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.

Posted
(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)
)

Posted
(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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...