text내용이 “300 x 150″이고 300 과 150을 분리해서 곱하는 리습을 만들려고 하는데요
(defun c:test1(/ ent dxf str str1 n a r x b h b1 h1 h2 w)
(setq ent (entsel))
(setq dxf (entget (car ent)))
(setq str (cdr (assoc 1 dxf)))
(setq str1 (itoa str))
(setq n (strlen str1))
(setq a 2)
(setq r 1)
(repeat r
(if (= x (substr str1 1 a))
(progn
(setq b (substr str1 1 (setq b1 (- 1 a))))
(setq h (substr str1 (setq h1 (+ 1 a)) (setq h2(- n a))))
)
(progn
(setq a (+ 1 a))
(setq r (+ 1 r))
)
)
)
(setq w (* b h 0.001))
(princ w)
(princ)
)
일단 이렇게 짜기는 했는데 str1부터 인식을 못 합니다…
문자와 숫자가 혼합 되어서 그런건지…..아니면 방법이 틀린건지….
itoa말고 ascii도 써 봤는데 역시나 인식을 못했습니다……
누가 방법좀 갈켜주세요~~~
공유