76
312
254
后起之秀
Error in dialog fileline 2: syntax error.Symbol: "key".
;Tip1756a: MESSAGE.LSP Message Service (c)2001, John R. Fair III; $50 Bonus Winner;;; ----------------------------------------------------------;;; Message.lsp is a program to store and retrieve ;;;; information about a drawing. Use it to save notes to ;;;; yourself or others, information about "odd" non-standard ;;;; things you were asked to do to a drawing. Saves right in;;;; the drawing, retrieve the message the next day, next week;;;; or next year.;;; ----------------------------------------------------------;;; ************ main function *******************************(defun C:MESSAGE (/ MSG-CMD MSG-DCL_ID) (setq OLDERR *ERROR* *ERROR* MERR ) ; end setq (if (< (setq MSG-DCL_ID (load_dialog "message.dcl")) 0); if dialog file is not loaded (exit) ; then exit ) ; end if (if (not (new_dialog "message" MSG-DCL_ID)); if dialog box is not loaded (exit) ; then exit ) ; end if (SHOW_LIST "exmess") (action_tile "exmess" "(show_info $value)") (action_tile "delete" "(delmessage (get_tile "exmess"))") (action_tile "store" "(storemessage (get_tile "newmess"))") (action_tile "accept" "(yesno "Message has not been stored!" "" "Do you wish to save the message?" "")" ) ;_ end of action_tile (start_dialog) (princ)) ; close defun;;; ******************Store message function *******************(defun STOREMESSAGE (MSG-MSG / MSG-MESSAGE MSG-XNAME MSG-SCRT MSG-XNAME MSG-AMPM) (setq MSG-MESSAGE 1 MSG-SCRT (rtos (getvar "CDATE") 2 6) ) ; end setq (if (or (= MSG-MSG " ") (= MSG-MSG "")) (set_tile "error" "No Message to Store!") (progn (while (/= (dictsearch; Use while loop to find last message in drawing (namedobjdict) (strcat "message" (rtos MSG-MESSAGE 2 0)) ) ;_ end of dictsearch NIL ) ;_ end of /= (setq MSG-MESSAGE (1+ MSG-MESSAGE)) ) ; end while (setq MSG-XNAME ; use entmakex to create the xrecord with no owner. (entmakex (append (list '(0 . "XRECORD") '(100 . "AcDbXrecord")) (list (cons 1 MSG-MSG)) (list (cons 2 (getvar "LOGINNAME"))) ; Message stored by? (list (cons 3 (strcat (substr MSG-SCRT 5 2) ; Date Message stored on? "/" (substr MSG-SCRT 7 2) "/" (substr MSG-SCRT 1 4) ) ; end strcat ) ; end cons ) ; end list (list (cons 4 (strcat ; Time Message stored at? (if (<= (setq MSG-AMPM (fix (atof (substr MSG-SCRT 10 2)))) 12 ) ;_ end of <= (eval (substr MSG-SCRT 10 2)) (eval (rtos (- (fix (atof (substr MSG-SCRT 10 2))) 12) 2 0 ) ;_ end of RTOS ) ;_ end of eval ) ; end if ":" (substr MSG-SCRT 12 2) " " (if (>= MSG-AMPM 12) ; AM or PM ? (eval "pm") (eval "am") ) ; end if ) ; end strcat ) ; end cons ) ; end list ) ; end append ) ; end entmakex ) ; end setq (dictadd (namedobjdict); add the new xrecord to the named object dictionary. (strcat "message" (rtos MSG-MESSAGE 2 0))