|
기존 오토캐드에서 잘 사용했던 리습입니다. 이직하면서 캐디안을 쓰는데 리습이 안먹네요..
가능하실지 모르겠지만 도움좀 요청합니다.
엔터가 안먹어서 리습화일로 올려둡니다.
----------------------------------------------------------------------------------------------------------------- (vmon) ;;; 숫자택스트를 모두더해서 택스트를 써줌 (defun c:ee(/ tot ind ent) (setvar "cmdecho" 0) (prompt "\n>> 더해질 텍스트를 선택하세요...") (setq tot(ssget) ind 0) (setq number 0) (repeat (sslength tot) (setq a (entget(ssname tot ind))) (setq b (assoc 1 a)) (setq c (cdr b)) (setq cc (atof c)) (setq ma ( + number cc)) (princ (strcat " / " (rtos number 2 2) "+" (rtos cc 2 2) "=" (rtos ma 2 2) )) (setq number ( + number cc)) (setq ind (1+ ind)) ) (if (and ( = th nil)( = th2 nil))(setq th 2)) (if (and ( = th nil)( /= th2 nil))(setq th th2)) (setq ar (rtos number 2 2)) (setq po (getpoint (strcat "\n>> 텍스트가 써질 인써트포인트를 피크하세요 < 텍스트높이:"(rtos th 2 2)">..."))) (command "text" po th "0" ar) (setvar "cmdecho" 1) (princ) ) ;;; 숫자택스트를 모두더해서 택스트를 바꿔줌 (defun c:tt(/ tot ind ent) (prompt "\n>> 더해질 텍스트를 선택하세요...") (setq tot(ssget) ind 0)(terpri) (setq number 0) (repeat (sslength tot) (setq a (entget(ssname tot ind))) (setq b (assoc 1 a)) (setq c (cdr b)) (setq cc (atof c)) (setq ma ( + number cc)) (princ (strcat " / " (rtos number 2 2) "+" (rtos cc 2 2) "=" (rtos ma 2 2) )) (setq number ( + number cc)) (setq ind (1+ ind)) ) (terpri) (setq ar (rtos number 2 2)) (princ "\n>> 더해진 숫자로 바꿔줄 텍스트를 선택하세요... :") (setq ss (ssget)) (command "change" ss "" "" "" "" "" "" ar) (setvar "cmdecho" 1) (princ) ) ;;; 마지막으로 그려진 POLY LINE 의 면적을 구해서 택스트를 바꿔줌 (defun c:nn() (setvar "cmdecho" 0) (command "area" "e" "l") (setq ar (getvar "area")) (setq ar2 (rtos ar 2 2)) (princ "\n>> 구한 면적으로 바꿔줄 텍스트를 선택하세요... : ") (setq qq (ssget)) (command "change" qq "" "" "" "" "" "" ar2) (setvar "cmdecho" 1) ) ;;; 마지막으로 그려진 POLY LINE 의 면적을 구해서 택스트를 써줌 (defun c:aa() (setvar "cmdecho" 0) (command "area" "e" "l") (setq ar (getvar "area")) (princ (strcat "area ==> " (rtos ar 2 2))) (setq ar2 (rtos ar 2 2)) (setq po (getpoint (strcat "\n>> 텍스트를 써줄 인써트포인트를 피크하세요. <텍스트 높이:"(rtos th 2 2)">..."))) (if (and ( = th nil)( = th2 nil))(setq th 2)) (if (and ( = th nil)( /= th2 nil))(setq th th2)) (command "text" po th "0" ar2) (setvar "cmdecho" 1) ) ;;; 처음으로 선택한 숫자택스트에서 나중선택한 택스트를 뺀수로 택스트를 바꿔줌 (defun c:zz(/ tot ind ent) (setvar "cmdecho" 0) (prompt "\n>> 첫번째 텍스트를 선택하세요 : ") (setq tot1(ssget)) (setq a (entget(ssname tot1 0))) (setq b (assoc 1 a)) (setq c (cdr b)) (setq cc (atof c)) (prompt "\n>> 첫번째 선택한 텍스트에서 마이너스할 텍스트를 선택하세요 : ") (setq tot2(ssget)) (setq a (entget(ssname tot2 0))) (setq b (assoc 1 a)) (setq c (cdr b)) (setq ccc (atof c)) (setq number (- cc ccc)) (setq ar (rtos number 2 2)) (princ (strcat "area ==> "(rtos number 2 2))) (princ "/n>> 구한 텍스트로 바꿔줄 텍스트를 선택하세요... ") (setq ss (ssget)) (command "change" ss "" "" "" "" "" "" ar) (setvar "cmdecho" 1) (princ) ) ;;; 면적을 찍어서 택스트를 써줌 (defun c:ca( / TEX Q AR PT1 ) (graphscr) (setvar "cmdecho" 0) (setq number 0) (if (and ( = asc nil)( = asc2 nil))(setq asc 1000)) (if (and ( = asc nil)( /= asc2 nil))(setq asc asc2)) (while (setq dum (bpoly (getpoint (strcat "\n>> 면적 구할 곳을 피크하세요 <도면스케일 = 1/"(rtos asc 2 0)">")))) (command "AREA" "entity" dum) (setq nu (getvar "AREA")) (setq nu (* (/ (* asc asc) 1000000) nu)) (if ( = number nil) (setq number 0)) (setq number ( + number nu)) (princ (strcat "면적 ==>"(rtos number 2 2))) ) (setq AR (rtos number 2 2)) (if (and ( = th nil)( = th2 nil))(setq th 2)) (if (and ( = th nil)( /= th2 nil))(setq th th2)) (setq PT1 (getpoint (strcat "\n>> 구한 면적을 텍스트로 써줄 인써트포인트를 피크하세요 <텍스트높이:"(rtos th 2 2)">..."))) (command "text" pt1 th "0" ar) (setq number 0) (setvar "cmdecho" 1) ) ;;; 면적을 찍어서 택스트를 바꿔줌 (defun c:vv( / TEX Q AR PT1 ) (graphscr) (setvar "cmdecho" 0) (setq number 0) (if (and ( = asc nil)( = asc2 nil))(setq asc 1000)) (if (and ( = asc nil)( /= asc2 nil))(setq asc asc2)) (while (setq dum (bpoly (getpoint (strcat "\n>> 면적 구할곳을 피크하세요 <도면스케일 = 1/"(rtos asc 2 0)">")))) (command "AREA" "entity" dum) (setq nu (getvar "AREA")) (setq nu (* (/ (* asc asc) 1000000) nu)) (if ( = number nil) (setq number 0) ) (setq number ( + number nu)) (princ (strcat "면적 ==>"(rtos number 2 2))) ) (setq AR (rtos number 2 2)) (princ "\n>> 구한면적으로 바꿔줄텍스트를 선택하세요 : ") (setq TT (ssget)) (command "CHANGE" TT "" "" "" "" "" "" AR) (setq number 0) (setvar "cmdecho" 1) ) ;;; POLYLINE 의 LT를 모두 ON 시켜줌 (defun c:LL(/ tot ind ent) (prompt "\n>> lt --> on 시킬 pline을 선택하세요 : ") (setq tot(ssget) ind 0) (repeat (sslength tot) (setq ent(cdar(entget(ssname tot ind))) ind(1+ ind)) (command "Pedit" ent "lt" "on" "") ) (princ) ) ;;; 입력하는 두숫자를 더해서 택스트를 바꿔줌 (defun c:jj() (setvar "cmdecho" 0) (setq a (getreal "\n>>input first number : ")) (setq b (getreal "\n>>input second number : ")) (setq c ( + a b)) (setq cc (rtos c 2 2)) (princ (strcat (rtos a 2 2) " + " (rtos b 2 2) " = " (rtos c 2 2)))(terpri) (princ "\n>>select change text :") (setq tt (ssget)) (command "change" tt "" "" "" "" "" "" cc ) (setvar "cmdecho" 1) ) ;;; 택스트의 글씨높이 조정 (defun C:th() (if (and ( = th nil) ( = th2 nil))(setq th 2)) (if (and ( = th nil)( /= th2 nil))(setq th th2)) (setq th (getdist (strcat "\n>> text new high <" (rtos th 2 2) "> : "))) (if ( /= th nil)(setq th2 th)) ) ;;; 도면의 SCALE를 줍니다. (기본값은 1 : 1,000 입니다.) (defun C:asc() (if (and ( = asc nil) ( = asc2 nil))(setq asc 1000)) (if (and ( = asc nil)( /= asc2 nil))(setq asc asc2)) (setq asc (getdist (strcat "\n>> domun scale <1/" (rtos asc 2 0) "> : "))) (if ( /= asc nil)(setq asc2 asc)) ) ;;; BB2에서 써준 택스트로 택스트를 바꿔줌 (defun c:bb() (setvar "cmdecho" 0) (prompt "\n>>select change text : ") (setq vvv (ssget)) (command "CHANGE" vvv "" "" "" "" "" "" vvv2) (setvar "cmdecho" 1) ) (defun c:bb2() (setq vvv2 (getstring "\n>>input text : ")) ) (defun c:ff() (setq a (ssget "x" '((62 . 41)))) (command "ERASE" a "")) (defun c:co() (command "color" "41")) (defun c:hto() (princ"")(terpri) (princ" command: ca --> 면적구해서 써주기")(terpri) (princ" command: vv --> 면적구해서 텍스트 바꿔주기")(terpri) (princ" command: ee --> 숫자더해서 써주기")(terpri) (princ" command: tt --> 숫자바꿔서 텍스트 바꿔주기")(terpri) (princ" command: th --> 쓰여질 텍스트 높이 (기본값은 2.00)")(terpri) (princ" command: asc --> 캐드상에서 그려진 도면의 스케일 (기본값은 1/1000)")(terpri) (princ"")(terpri) )
첫댓글 어떤 명령을 실행했을 때~
어떤 에러가 나는지를
표기해 주시기 바랍니다.