From AutoCAD
;;;TIP.LSP shows a tip using TIP.DVB until user unchecks box
;;;Copyright 2004 by Thomas Gail Haws
;;;
;;; This program is free software under the terms of the
;;; GNU (GNU--acronym for Gnu's Not Unix--sounds like canoe)
;;; General Public License as published by the Free Software Foundation,
;;; version 2 of the License.
;;;
;;; You can redistribute this software for any fee or no fee and/or
;;; modify it in any way, but it and ANY MODIFICATIONS OR DERIVATIONS
;;; continue to be governed by the license, which protects the perpetual
;;; availability of the software for free distribution and modification.
;;;
;;; You CAN'T put this code into any proprietary package. Read the license.
;;;
;;; If you improve this software, please make a revision submittal to the
;;; copyright owner at hawstom@despammed.com or see www.hawsedc.com.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;; GNU General Public License on the World Wide Web for more details.
;;;
;;; Revisions
;;; 2009/02/01 TGH Changed storage engine from a line at the top of TIP.LSP to (setcfg) function
;|
This code also relies on the tip.dvb vba form available at AutoCAD Wiki as
Media:Tip.dwg (disguised for security purposes as a dwg file).
Edit the source code for this function at
Tipvba (AutoLISP function)
|;
;;;
;;;
(DEFUN
C:TIP ()
(WIKI-TIP
0
"Use TIP.LSP and TIP.DVB to show your users a tip until they uncheck the box below."
)
(WIKI-TIP
1
"TIP.LSP stores the list of unchecked tips using the (setcfg) and (getcfg) functions."
)
(WIKI-TIP
2
"Use VBAMAN and VBAIDE to adjust the size of this form as required."
)
)
(DEFUN
WIKI-TIP (TIPID TIPTEXT / FNAME LINELIST RDLIN STRTIPLIST TIPLIST
USERSOLD1
)
;;Early versions of TIP asked for integer tip ids.
;;Convert if given.
(COND ((= (TYPE TIPID) 'INT) (SETQ TIPID (ITOA TIPID))))
(SETQ STRTIPLIST (GETCFG "AppData/Wiki/Tip/HiddenTips"))
(COND
;;If the tip requested is in the hidden tip list
((AND
STRTIPLIST
(SETQ TIPLIST (WIKI-STRTOLST STRTIPLIST "`," "" T))
(MEMBER TIPID TIPLIST)
)
)
(T
(COND
((>= (ATOF (GETVAR "acadver")) 15)
(SETQ USERS1OLD (GETVAR "users1")) ;_ end of setq
(SETVAR "users1" TIPTEXT)
(COMMAND "-vbarun" "tip.dvb!modTip.Tip")
(COND
((= (GETVAR "users1") "BooleanFalse")
(SETVAR "users1" USERS1OLD)
(SETCFG
"AppData/Wiki/Tip/HiddenTips"
(COND
(STRTIPLIST (STRCAT STRTIPLIST "," TIPID))
(TIPID)
)
)
)
)
)
(T
(ALERT
"\nSorry. I don't think this version of AutoCAD can run a Visual Basic Script.\n\nTom Haws at AutoCAD Wiki"
) ;_ end of alert
)
) ;_ end of COND
)
)
) ;_ end of defun