캐드 관련글/Auto Cad (오토캐드)
선 길이 합산 리습
오츠
2012. 2. 2. 09:53
728x90
1.로드방법:1)명령어 appload 2)다운받은파일 로드
2.사용방법:
1)명령어:leto
2)선,원,호,스플라인,폴리라인 등등...클릭 or 드래그
3)prompt창에 길이합계= ??? 출력...끝
3.리습편집:붉은색 leto 를 원하는 명령어로 수정
(defun c:leto ()
(vl-load-com)
(setq ent (ssget '((0 . "LINE,CIRCLE,ARC,POLYLINE,LWPOLYLINE,ELLIPSE,SPLINE"))))
(setq n 0 dis 0)
(repeat (sslength ent)
(setq en (vlax-ename->vla-object (ssname ent n)))
(setq ep (vlax-curve-getEndParam en))
(setq dis (+ dis (vlax-curve-getDistAtParam en ep)))
(setq n (1+ n))
)
(prompt (strcat "길이합계= " (rtos dis)))(princ)
)
728x90