;;;Replaces dumb "circle-line-text" CDM bubbles with block versions of CDM bubbles. ;;;Retains existing fill-in info. ;;; ;;;> Author: Henry C. Francis ;;;> 425 N. Ashe St. ;;;> Southern Pines, NC 28387 ;;;> http://paracadd.com ;;;> All rights reserved. ;;; ;;;> COPYRIGHT: ;;;> EDITED: 09-14-2001 ;;; (DEFUN C:BUBFIX () (if dimscl nil (load "dimscl" "\nFile DIMSCL.LSP not found!")) (dimscl) (SETQ said_it nil repl_cnt 0) (if (eq bubrad 0.375) nil (setq bubrad 0.25) ) (SETQ bcirc_ss (SSGET "X" (LIST (CONS -4 "") (CONS 40 (*(- bubrad 0.003)DIMSC)) (CONS -4 "<") (CONS 40 (*(+ bubrad 0.003)DIMSC)) (CONS 0 "CIRCLE") (CONS -4 "AND>") ) ;_ end of LIST ) ;_ end of SSGET ) ;_ end of SETQ (IF bcirc_ss (PROGN (SETQ bcss_len (SSLENGTH bcirc_ss)) (SETQ stp_cnt 0) (WHILE (< stp_cnt bcss_Len) (SETQ cur_circ (ENTGET (SSNAME bcirc_ss stp_cnt))) (SETQ circ_cen (CDR (ASSOC 10 cur_circ))) (SETQ circ_rad (CDR (ASSOC 40 cur_circ))) (SETQ pt1 (POLAR circ_cen 0 circ_rad) pt2 (POLAR circ_cen (/ PI 6) circ_rad) pt3 (POLAR circ_cen (* (/ PI 6) 2) circ_rad) pt4 (POLAR circ_cen (/ PI 2) circ_rad) pt5 (POLAR circ_cen (* (/ PI 6) 4) circ_rad) pt6 (POLAR circ_cen (* (/ PI 6) 5) circ_rad) pt7 (POLAR circ_cen PI circ_rad) pt8 (POLAR circ_cen (* (/ PI 6) 7) circ_rad) pt9 (POLAR circ_cen (* (/ PI 6) 8) circ_rad) pt10 (POLAR circ_cen (* (/ PI 6) 9) circ_rad) pt11 (POLAR circ_cen (* (/ PI 6) 10) circ_rad) pt12 (POLAR circ_cen (* (/ PI 6) 11) circ_rad) ptl1 (POLAR (POLAR pt1 0 (/ circ_rad 20.00)) (/ PI 2) (/ circ_rad 20.00) ) ;_ end of polar ptl1a (POLAR (POLAR pt7 PI (/ circ_rad 20.00)) (/ PI 2) (/ circ_rad 20.00) ) ;_ end of polar ptl2 (POLAR (POLAR pt7 PI (/ circ_rad 20.00)) (* PI 1.5) (/ circ_rad 20.00) ) ;_ end of polar ptl2a (POLAR (POLAR pt1 0 (/ circ_rad 20.00)) (* PI 1.5) (/ circ_rad 20.00) ) ;_ end of polar ) ;_ end of setq (SETQ bubble_text (SSGET "WP" (LIST pt1 pt2 pt3 pt4 pt5 pt6 pt7 pt8 pt9 pt10 pt11 pt12) ;_ end of LIST '((0 . "TEXT")) ) ;_ end of ssget ) ;_ end of setq (IF bubble_text (PROGN (SETQ btxt_sslen (SSLENGTH bubble_text)) (SETQ btxt_cnt 0 btxt_lst nil ) ;_ end of setq (WHILE (< btxt_cnt btxt_sslen) (IF btxt_lst (SETQ btxt_lst (APPEND btxt_lst (LIST (CDR (ASSOC 1 (ENTGET (SSNAME bubble_text btxt_cnt) ) ;_ end of entget ) ;_ end of assoc ) ;_ end of cdr ) ;_ end of list ) ;_ end of append ) ;_ end of setq (SETQ btxt_lst (LIST (CDR (ASSOC 1 (ENTGET (SSNAME bubble_text btxt_cnt)) ) ;_ end of assoc ) ;_ end of cdr ) ;_ end of list ) ;_ end of setq ) ;_ end of if (SETQ btxt_cnt (1+ btxt_cnt)) ) ;_ end of while (FOREACH n btxt_lst (IF (OR (WCMATCH n "`?`?") (WCMATCH n "`?") (WCMATCH n "*-*") (WCMATCH n "-") (WCMATCH n "VAR") (WCMATCH n "VARIES")) (IF sheet_str (SETQ sheet_str (STRCAT sheet_str " " n)) (SETQ sheet_str n) ) ;_ end of if (IF detail_str (SETQ detail_str (STRCAT detail_str " " n)) (SETQ detail_str n) ) ;_ end of if ) ;_ end of if ) ;_ end of foreach (SETQ bubble_line (SSGET "CP";(if (eq bubrad 0.25) "WP" "CP") (LIST ptl1 ptl1a ptl2 ptl2a) '((0 . "LINE"));(if (eq bubrad 0.25)'((0 . "LINE"))'((0 . "LINE")(62 . 5))) ) ;_ end of ssget ) ;_ end of setq (IF (AND bubble_text bubble_line sheet_str detail_str dimsc) (PROGN (ENTDEL (CDR (ASSOC -1 cur_circ))) (COMMAND ".erase" bubble_text "") (if (eq bubrad 0.25) (COMMAND ".erase" bubble_line "") ) (SETQ old_attreq (GETVAR "attreq")) (SETQ old_attdia (GETVAR "attdia")) (SETVAR "attreq" 1) (SETVAR "attdia" 0) (COMMAND ".insert" (if (eq bubrad 0.25) "b1" "b" ) (LIST (CAR circ_cen) (CADR circ_cen) (* 1001 dimsc)) dimsc dimsc (* (/ (- (* 2 PI) (GETVAR "viewtwist")) (* 2 PI)) 360 ) ;_ end of * detail_str sheet_str ) ;_ end of command (SETVAR "attreq" old_attreq) (SETVAR "attdia" old_attdia) (SETQ repl_cnt (1+ repl_cnt)) ) ;_ end of progn (progn (PRINC "\nUnable to replace bubble!") (princ "\n ") (princ "bubble_text = ") (princ bubble_text) (princ "\n ") (princ "bubble_line = ") (princ bubble_line) (princ "\n ") (princ "btxt_lst = ") (princ btxt_lst) (princ "\n ") (princ "detail_str = ") (princ detail_str) (princ "\n ") (princ "sheet_str = ") (princ sheet_str) (princ "\n ") (princ "dimsc = ") (princ dimsc) (princ "\n") ) ) ;_ end of progn (SETQ sheet_str nil detail_Str nil ) ;_ end of setq ) ;_ end of progn (IF said_it (PRINC) (PROGN (PRINC (STRCAT "\nNo bubble text found in " (IF (AND (EQ (GETVAR "tilemode") 0) (EQ (GETVAR "cvport") 1) ) ;_ end of and "Paper Space!" "Model Space!" ) ;_ end of if ) ;_ end of strcat ) ;_ end of princ (SETQ said_it T) ) ;_ end of progn ) ;_ end of if ) ;_ end of if (SETQ stp_cnt (1+ stp_cnt)) ) ;_ end of while ) ;_ end of progn (IF said_it (PRINC) (PROGN (PRINC (STRCAT "\nNo detail bubbles found in " (IF (AND (EQ (GETVAR "tilemode") 0) (EQ (GETVAR "cvport") 1)) "Paper Space!" "Model Space!" ) ;_ end of if ) ;_ end of strcat ) ;_ end of princ (SETQ said_it T) ) ;_ end of progn ) ;_ end of if ) ;_ end of if (IF (> repl_cnt 0) (princ (strcat "\n" (ITOA repl_cnt) " detail bubbles replaced with " (if (eq bubrad 0.25)"\"B1\"" "\"B\"") " blocks. ")) ) (if (eq bubrad 0.25) (progn (setq bubrad 0.375) (c:bubfix) (setq bubrad nil) ) ) (PRINC) ) ;_ end of DEFUN ;|«Visual LISP© Format Options» (72 2 40 2 T "end of " 60 9 2 0 0 T T nil T) ***Don't add text below the comment!***|;