;** with a few modifications by J. Marsden DeLapp 7/3/96 ; ;;; Program File ......... REVCLOUD.LSP ;;; Main Function ........ C:RVC ;;; Written By ........... Steven H. Guthrie ;;; ;;; Compatibility: r13 ; JMD-Also compatible with r12 using a cloudtag.dwg that is r12. ;;; ;;; Updated and modified by Jeff Bitgood ;;; ;;; Notes: This routine draws revision clouds using pline arcs with ;;; a 0.0 beginning width and a (0.02 x Scale Factor) ending ;;; width to give a hand drawn appearance. Clouds should be ;;; drawn in a counter-clockwise direction for arc bulges to ;;; lay toward the drawing extents and a clockwise direction ;;; for arc bulges to lay towards drawing interior. ;;; ;;; This command will prompt for a revision number and create ;;; a layer named REVISION_CLOUDS_#, # being the revision ;;; number prompted for. After completing the cloud, a ;;; revision tag will be placed with the proper number and a ;;; leader. This can later be edited with DDATTE. ;;; ;;; The Scale Factor value used for determining ending width ;;; of each arc is obtained from system variable "DIMSCALE". ;;; ;;;--------------------------------------------------------------------- ;;; Revision History: ;;; ;;; Version ..... 1.0 10-10-91 Initial Release ;;; Version ..... 1.1 01-08-92 Revise internal *error* function ;;; and Added Undo/Close options ;;; Version ..... 2.0 01-15-92 Final Release ;;; Version ..... 3.0 06-29-96 Fixed problem with osnaps, added ;;; Revision Set feature and revision ;;; tag, changed name to RVC for ;;; compatibility with Softdesk 7 ;;; Version ..... 3.01 07-03-96 JMD Added a global variable revnum ;;; so you don't have to enter it each ;;; time. Got rid of the arc thing at ;;; the end. ;;;--------------------------------------------------------------------- ;JMD changes ... ;RVC_revnum is a global variable. (if (= RVC_revnum nil) (setq RVC_revnum "0")) ;make sure revnum exists and is string ;end JMD change (defun C:RVC ( / m:BM m:OM m:OER m:P1 m:P2 m:PL m:CLS m:ANG m:CNT m:DST m:SC m:OSM m:REVNUM m:LYR m:NEWLAY m:PLACETAG) (setvar "CMDECHO" 0) (princ "\n> Revision Cloud, ver 3.01 JMD... 7-3-96") (setq m:BM (getvar "BLIPMODE")) (setq m:OM (getvar "ORTHOMODE")) ;;; Beginning of changes 06-29-96 ---------------------- (setq m:OSM (getvar "OSMODE")) ; JMD moved revnum stuff to the end then moved it back. Revnum is needed ; for the layer name! ; (setq m:REVNUM (getstring "\nEnter the revision set: ")) ; JMD changes ... note revnum is string and can be letter. ;setup prompt string (setq prompstr (strcat "\nEnter the revision set <" RVC_revnum)) (setq prompstr (strcat prompstr ">:")) (setq m:REVNUM (getstring prompstr)) (if (= (strlen m:REVNUM) 0) ;if nothing entered (setq m:REVNUM RVC_revnum) ;use default (setq RVC_revnum m:REVNUM) ;else change global revnum );if ; end JMD changes (setq m:LYR (getvar "CLAYER")) ;;; End of changes 06-26-96 ---------------------------- (setq m:OER *error*) (defun *error* (s) (setvar "BLIPMODE" m:BM) (setvar "ORTHOMODE" m:OM) ;;; Beginning of changes 06-29-96 ---------------------- (setvar "CLAYER" m:LYR) (setvar "OSMODE" m:OSM) ;;; End of changes 06-26-96 ---------------------------- (princ (strcat "\Exit..." s)) (if m:OER (setq *error* m:OER)) (princ)) (setvar "BLIPMODE" 0) (setvar "ORTHOMODE" 0) ;;; Beginning of changes 06-29-96 ---------------------- (setq m:NEWLAY (strcat "REVISION_CLOUDS_" m:REVNUM)) (if (null (tblsearch "LAYER" m:NEWLAY)) (command "._layer" "new" m:NEWLAY "s" m:NEWLAY "") (setvar "CLAYER" m:NEWLAY)) ;;; End of changes 06-26-96 ---------------------------- (setq m:P1 (getpoint "\nFrom Point: ") m:SC (GETVAR "DIMSCALE") m:CNT 0 m:PL (list (list m:CNT m:P1))) (if m:P1 (command "._pline" m:P1 "A")) (while m:P1 (if (/= m:CNT 0) (progn (initget "Undo Close") (setq m:P2 (getpoint m:P1 "\nUndo/Close/: ")) (cond ((= m:P2 "Close") (setq m:CLS "Close" m:P2 (cadr (last m:PL)))) ((= m:P2 "Undo") (repeat (car (nth 0 m:PL)) (command "u")) (setq m:PL (cdr m:PL)) (setq m:CNT (car (nth 0 m:PL)) m:P1 (cadr (nth 0 m:PL))) (if (= m:CNT 0) (command "A"))) ((= m:P2 nil) (command "W" "0.0" "0.0" "") (setq m:P1 nil)) ) ) (setq m:P2 (getpoint m:P1 "\nEndpoint: ")) ) (if (= (type m:P2) 'LIST) (progn (setq m:ANG (angle m:P1 m:P2) m:CNT (/ (distance m:P1 m:P2) (* 0.5 m:SC))) (cond ((and (>= m:CNT 1.0) (< m:CNT 2.0)) (setq m:CNT 2)) ((< m:CNT 1.0) (setq m:CNT 1)) (T (setq m:CNT (fix m:CNT))) ) (setq m:DST (/ (distance m:P1 m:P2) m:CNT)) (repeat m:CNT (command "w" "0.0" (* 0.02 m:SC) "S" (polar (polar m:P1 m:ANG (/ m:DST 2.0)) (- m:ANG 1.57) (/ m:DST 4.0) ) (setq m:P1 (polar m:P1 m:ANG m:DST)) ) ) (setq m:PL (cons (list m:CNT m:P2) m:PL)) (if (= m:CLS "Close") (progn (command "W" "0.0" "0.0" "") (setq m:P1 nil) ) ) ) ) ) ;;; Beginning of changes 06-29-96 ---------------------- (setq m:PLACETAG (getpoint "\nPlace the cloud's tag: ")) (command "._insert" "cloudtag" m:PLACETAG (getvar "DIMSCALE") "" "0" m:REVNUM) ;JMD changes ... ; (princ "\nNow place the leader using a 3-point arc. ") ; (command "._arc") ;JMD eliminated, not sure what this is for. (setvar "CLAYER" m:LYR) (setvar "OSMODE" m:OSM) ;;; End of changes 06-26-96 ---------------------------- (setvar "ORTHOMODE" m:OM) (setvar "BLIPMODE" m:BM) (princ) ) (princ "\nRevcloud loaded. Start with command RVC");JMD changes