길이산출하는 리습들이 꽤잇다는거는 아는데
0.00m로 나오는 리습이 있을까요?ㅠㅠㅠ
(defun c:lK (/ ent n dis ent_l #a #ad #as th)
(setvar “cmdecho” 0)
(setq ent (ssget ‘((0 . “LINE,CIRCLE,ARC,POLYLINE,LWPOLYLINE,ELLIPSE,SPLINE”))))
(setq th (getreal (strcat “n텍스트 높이 입력 <” (rtos (getvar “textsize”)) “>:”)))
(if th (setvar “textsize” th))
(setq n 0 dis 0)
(repeat (sslength ent)
(setq ent_l (ssname ent n))
(command “lengthen” ent_l “”)
(setq dis (+ dis (GETVAR “PERIMETER”)))
(setq n (1+ n))
)
(setq #a(strcat (rtos (* 0.001 dis) 2 3)))
(prompt (strcat “n” #a))
(vl-load-com)
(setq #ad(vla-get-activedocument(vlax-get-acad-object)))
(setq #as
(if (> (vla-get-activespace #ad) 0)
(vla-get-modelspace #ad)
(vla-get-paperspace #ad)
);;if
);;setq
(vla-addtext #as #a (vlax-3d-point (trans (getpoint “n≫≫≫Pick text point:”) 1 0)) (getvar “textsize”))
(mapcar ‘vlax-release-object (list #as #ad))
(princ)
(setvar “cmdecho” 1)
)
이리습을 사용중인데 이것은 선길이 합까지 다 나오는 리습인데 정수일경우나 0.000까지나오는데
무족건 0.00까지만 나오게 수정할수있는 방법이잇나요?ㅠㅠㅠ
공유
(setq #a(strcat (rtos (* 0.001 dis) 2 3)))
저기 마지막에 3이라고 된게 소숫점 자리 지정하는 겁니다.
그앞에 2라고 된거는 10진법을 의미합니다.