본문 바로가기
autocad

Print Distance of 2 points; Specify Precision

by kmlab 2025. 8. 19.

;; 두점의 거리를 출력할 때 정밀도 조정하기
;; (distance) (rtos) (luprec)

(defun KM:pdist ( / )
(setq ss (ssget '((0 . "LINE")))); select a line
(setq dx (entget (ssname ss 0))); get dxf of the line
(setq p1 (cdr (assoc 10 dx)) p2 (cdr (assoc 11 dx))); get coordinates of endpoint of the line
(print p1)
(print (rtos (distance p1 p2) 2 16)); specify precision of value
)

 

;; 결국, 캐드가 정밀하게 계산하고, 결과값은 rtos로 소숫점 자리를 조정할 수 있다.
;; 다음은 LEE MAC 도사님의 멋진 유틸입니다.

 

 

Length at Midpoint | Lee Mac Programming

Length at Midpoint Function Syntax midlen Current Version 1.1 Download MidLenV1-1.lsp View HTML Version MidLenV1-1.html Donate Program Description This program automatically generates multiline text (MText) objects positioned over the midpoint of every obj

www.lee-mac.com

(defun c:midlen ( /

반응형