(defun c:ds ()
(setvar “cmdecho” 0)
(setq ent (ssget ‘((0 . “LINE,CIRCLE,ARC,POLYLINE,LWPOLYLINE,ELLIPSE,SPLINE”))))
(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 dis (rtos (/ dis 1000) 2 2))
(prompt (strcat “n>> 선택 객체수 = “(rtos n)” 길이합계 = ” dis))(princ)
(princ “nDo You Want Write it into the DWG? <y> “)
(setq z (strcase (getstring)))
(if (or (= z “”) (= z “Y”))
(progn
(setq pt (getpoint “nText Point: “))
(setq h (getvar “textsize”))
(prompt “nText Height: “)
(princ H)
(princ ” : “)
(setq z (getdist))
(if z
(setq h z)
)
(command “text”
(setq z pt)
(setq z h)
(setq z 0)
(setq z dis)
(setvar “cmdecho” 1))))
)
길이구할때 소수점 아래까지 나오네요.소수점 안나오게 바꿀수 있나요?알고 계신분 부탁드려요.
공유
명령어 D 치신후 후행을 눌러주시길 바랍니다. 정밀도 가보시면 0.0
0.000 이런거 보일꺼에여
거기서 골라서 하시면되여 ~
답해 주셔서 감사합니다.
명령어 D쳐보니 치수 스타일 관리자 나오네요.
거기서 단위를 바꿔봐도 그대로 이네요.^^
(setq dis (rtos (/ dis 1000) 2 2))를
(setq dis (rtos (/ dis 1000) 2 0))로 수정하세요~
2를 0으로 바꾸심 됩니다.
해결 되었네요..감사합니다^^