Dear All,
It's possible every time cad open & alert msg box with image
new message or tips every day randomly with image
(sample msg)
Copy and print on both sides of paper.
Reuse items like envelopes, folders and paper clips.
Use mailer sheets for interoffice mail instead of an envelope.
Set up a bulletin board for memos instead of sending a copy to each employee.
Use e-mail instead of paper correspondence.
Use recycled paper.
Use discarded paper for scrap paper.
Encourage your school and / or company to print documents with soy-based inks, which are less toxic.
Use a ceramic coffee mug instead of a disposable cup.
(you can improve the environment)
autolisp code - ;;; Quote generator
- ;;; Read quotes from Dat File
- (defun ReadQuotes (filDat / strDatFile filDatOpen txtNewLine lstQuotes)
- (setq filDatOpen (open filDat "r"))
- (while (setq txtNewLine (read-line filDatOpen))
- (setq lstQuotes (cons (read txtNewLine) lstQuotes))
- )
- (close filDatOpen)
- (setq lstQuotes (reverse lstQuotes))
- )
- ;;; Write quotes back to Dat File
- (defun WriteQuotes (filDat lstQuotes / filDirScript intCounter)
- (setq filDatOpen (open filDat "W"))
- (foreach strLine lstQuotes
- (print strLine filDatOpen)
- )
- (close filDatOpen)
- (princ)
- )
- ;;; Displays a quote from a selected Dat file
- ;;; The Dat file must have a blank line at the top and be in the following format
- ;;;(" Copy and print on both sides of paper. "0)
- ;;;(" Reuse items like envelopes, folders and paper clips. "0)
- ;;;...
- (defun c: goGreen (/ lstofQuotes lstNextRead lstMarkasRead)
- (if (setq filDat (findfile "gogreen.dat")); check for dat file
- (progn; if true
- (setq lstofQuotes (cdr (ReadQuotes filDat))); read dat file
- (setq intNextRead (vl-position '(0) (mapcar' (lambda (strQuote) (member '0 strQuote)) lstofQuotes))); check for the first 0 (un read line) in the file
- (if intNextRead
- (setq lstNextRead (nth intNextRead lstofQuotes)); if it finds an unread quote read it
- (progn; if not set all quotes to unread and read the first line in the file
- (setq lstofQuotes (mapcar '(lambda (lstQuote) (subst '0 '1 lstQuote)) lstofQuotes))
- (setq intNextRead (vl-position '(0) (mapcar' (lambda (strQuote) (member '0 strQuote)) lstofQuotes)))
- (setq lstNextRead (nth intNextRead lstofQuotes))
- )
- )
- (setq lstMarkasRead (subst '1 '0 lstNextRead)); change the 0 to 1 to mark that this quote has been read
- (setq lstofQuotes (subst lstMarkasRead lstNextRead lstofQuotes)); change this quote to read in the original list
- (WriteQuotes fildat lstofQuotes); re-write list of quotes in dat file to show it as read
- (alert (car lstNextRead)); notify user of quote
- )
- (progn; if GoGreen.dat not found
- (princ "\ nFile GoGreen.dat not found!"); notify user
- (setq fildat (vl-string-subst "dat" "lsp" (findfile "gogreen.lsp "))); find path of this lisp
- (setq lstofQuotes' (( "Copy and print on both sides of paper." 0)
- ( "Reuse items like envelopes, folders and paper clips." 0)
- ( "Use mailer sheets for interoffice mail instead of an envelope." 0)
- ( "Set up a bulletin board for memos instead of sending a copy to each employee." 0)
- ( "Use e-mail instead of paper correspondence." 0)
- ( "Use recycled paper." 0)
- ( "Use discarded paper for scrap paper." 0)
- ( "Encourage your school and / or company to print documents with soy-based inks, which are less toxic." 0)
- ( "Use a ceramic coffee mug instead of a disposable cup." 0))); create default list of quotes
- (WriteQuotes fildat lstofQuotes); create GoGreen.dat
- (princ "\ nNew GoGreen.dat file has been created."); notify user
- (setq lstofQuotes (cdr (ReadQuotes filDat))); read dat file
- (setq intNextRead (vl-position '(0) (mapcar' (lambda (strQuote) (member '0 strQuote)) lstofQuotes))); check for the first 0 (un read line) in the file
- (setq lstNextRead (nth intNextRead lstofQuotes)); read first unread quote
- (setq lstMarkasRead (subst '1 '0 lstNextRead)); change the 0 to 1 to mark that this quote has been read
- (setq lstofQuotes (subst lstMarkasRead lstNextRead lstofQuotes)); change this quote to read in the original list
- (WriteQuotes fildat lstofQuotes); re-write list of quotes in dat file to show it as read
- (alert (car lstNextRead)); notify user of quote
- )
- )
- (princ "\ nYou can improve the environment!"); notify user
- (princ)
- )
- (princ "\ nGoGreen.lsp is loaded. Type GoGreen to run."); notify user
|