안녕하세요 곱하기 리습이 필요한데 아무리 찾아봐도 없네요..ㅠㅠ
아래는 제가 사용하고있는 일괄 더하기 리습입니다.
선택한 텍스트를 입력한 수치만큼 일괄적으로 더해주는 리습인데
이걸 수정해서 일괄적으로 곱해주는 리습을 만들수 있을까요?
고수님들 부탁드립니다
(defun c:ncn(/ ss num k ed txt n numt q len @1 @2 txt1 txt2 txt3 newtxt)
(prompt “n>> 입력수치로 숫자만 증감시키기”)
(setq ss (ssget (list (cons 0 “text,mtext”))))
(if (not $num) (setq $num 1))
(setq num (getint (strcat “n증가할 수치<” (rtos $num 2 0) “>:”)))
(if num (setq $num num))
(setq k 0)
(repeat (sslength ss)
(setq ed (entget (ssname ss k)))
(setq txt (cdr (assoc 1 ed)))
(setq n 1 numt “” q 0 len (strlen txt))
(repeat len
(setq @1 (substr txt n 1))
(setq @2 (ascii @1))
(if (and (>= @2 48) (<= @2 57))
(progn
(setq numt (strcat numt @1))
(setq q n)
)
)
(setq n (1+ n))
)
(setq txt1 (substr txt 1 (- q (strlen numt))))
(setq txt2 (rtos (+ (atof numt) $num) 2 0))
(setq txt3 (substr txt (1+ q) (- len q)))
(setq newtxt (strcat txt1 txt2 txt3))
(entmod (subst (cons 1 newtxt) (assoc 1 ed) ed))
(setq k (1+ k))
)
(princ)
)
(setq txt2 (rtos (+ (atof numt) $num) 2 0)) 여기를
감사합니다.ㅠㅠ 잘 되네요