Hello all:
Just thought I'd throw this out for y'all (a Southern term)
I've been using various versions of this lisp routine for quite awhile. What it does is is pop up your own chart/table with a click of a custom button and then it goes away when you do anything else. It just overlays your drawing for reference purposes. I've got several versions for pipe sizes, fractions, tap and drill sizes, sheet metal gages, etc. Beats the heck out of grabbing a book or looking at that chart on the wall.
It's easy to modify for your own purposes. Just rename it to XXX.LSP and then use the 'find and replace' with wordpad using 'replace "PIPE"' with "XXX". Open the routine and it explains it better. If you want my charts, just ask and I'll be glad to send them to you. Works with all Windows versions of AutoCAD
Here is my pipe routine:
;; PIPE.LSP Pipe properties chart (c)2001, George Velon
;; Modified by Andy Anderson from the original VSF.lsp
;; PIPE.LSP - Routine to view a slide of a ANSI PIPE chart. ;;
;; This will overlay your drawing and disappear when you click anywhere again or hit any key. ;; ;;
;; When loading use ^C^C(load"XXX") instead of ^C^C_(load"XXX") ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; VARIABLES listed in the order that they appear: ;;
;; ;;
;; org_err : Store the current *error* handler ;;
;; org_cmdecho : Store the current cmdecho setting ;;
;; CMDECHO : System variable, Autolisp echoing on/off ;;
;; val : Store input data code ;;
;; code : Store input data code ;;
;; code_12 : Store input data code ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; SUB-ROUTINES listed in the order that they appear: ;;
;; ;;
;; PIPE_err : Abort routine ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; EXTERNAL FILES necessary: ;;
;; ;;
;; PIPE.sld : Slide file of a Pipe properties chart. ;;
;; This file must be in AutoCAD's path. ;;
;; PIPE.dwg : Although not necessary to the function of the program, ;;
;; this file is provided for customization purposes of the ;;
;; slide file. Simply edit the PIPE.dwg file for ;;
;; something such as color preference, and then ;;
;; re-create the PIPE.sld file. ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;===========================================================
;; Error Handling
;;===========================================================
(defun
PIPE_ERR (S)
(prompt "\nAn error occurred during the PIPE function.")
;; Print to screen
(if ;; Open if
(/= S "Function canceled")
;; If an error, (such as ESC) occurs
(princ (strcat "\n*** ERROR : " S " "))
;; Strcat and print to screen
) ;_ end of if
;; Close if
(redraw)
;; Clear the screen
(setq ORG_CMDECHO NIL
;; Restore var's to org state
VAL
NIL
CODE_12
NIL
CODE NIL
) ;_ end of setq
(setvar "CMDECHO" ORG_CMDECHO)
;; Restore the org CMDECHO setting
(setq *ERROR* ORG_ERR)
;; Restore org *error* handler
(princ)
;; Exit quietly
) ;_ end of defun
;; Close defun
;;===========================================================
;; Main Program
;;===========================================================
(defun
C:PIPE (/ ORG_CMDECHO VAL CODE_12 CODE)
;; Define function, declare local vars
(setq ORG_ERR *ERROR*
;; Store org "error" handler
*ERROR* PIPE_ERR
) ;_ end of setq
;; Set new "error" handler
(setq ORG_CMDECHO (getvar "CMDECHO"))
;; Store org CMDECHO
(setvar "CMDECHO" 0)
;; Supress echoing AutoLISP to screen
(graphscr)
;; Flip to graphics screen
(command "_.vslide" "PIPE")
;; View the "Pipe properties chart" slide
(prompt "\nPress any key to continue: ")
;; Prompt user to exit
(setq VAL ;; Open setq
(grread)
;; Pauses program, accepts any keyboard, or pointing device input to continue
) ;_ end of setq
;; Close setq
(if ;; Open if
(= 12 (car VAL))
;; Did user click pointing device in graphics area
(setq CODE_12 (grread (setq CODE (grread))))
;; If so, clear code 12 data from buffer
) ;_ end of if
;; Close if
(redraw)
;; Clear the screen
(setvar "CMDECHO" ORG_CMDECHO)
;; Restore org CMDECHO setting
(setq *ERROR* ORG_ERR)
;; Restore org *error* handler
(princ)
;; Exit quietly
) ;_ end of defun
;; Close main defun
(princ "\nPIPE.LSP for AutoCAD is loaded.")
;; Print introduction to screen
(princ "\nTo view a slide of the Pipe properties chart type PIPE.")
;; Print introduction to screen
(princ)
;; Exit quietly