XY 로 사용하면
객체스냅이 전부 꺼져버립니다..ㅠㅠ..
다시 모두 켜놓아도, XY 명령어만 쓰면 다시 ‘끝자리’ 객체스냅만 남음..;;
(defun c:xy(/ x1 x2 x3 x4 y1 y2 y3 y4 ax ay pt1 pt2 pt3 pt4 )
(princ “nXY 표시할 좌표 : n” )
;;dim 준비세팅
(defun SETERR(s)
(if (/= s “Function cancelled”)
(princ (strcat “nError: ” s))
); of If
(setq *error* oer seterr nil)
(princ)
); of SETERR
(setq oer *error* *error* seterr)
(setq ts (* (getvar “DIMTXT”) (GETVAR “DIMSCALE”))) ;dimension text크기
(setvar “cmdecho” 0)
(setvar “osmode” 1)
(setq pt1 (getpoint “nPick xy pt1: “))
(setvar “osmode” 0)
(setq pt2 (getpoint “nPick pt2: ” pt1))
(command “dim1” “leader” pt1 pt2 “” “n”);; 화살표 표시
(command “redraw”)
(command “erase” “l” “” ); 마지막 지시선 삭제
(setq pt3 (getpoint “nText Pick Left or Right pt3: “))
(setq x1 (car pt1))
(setq y1 (cadr pt1))
(setq ay (strcat “S. “(rtos y1 2 1)))
(setq ax (strcat “E. “(rtos x1 2 1)))
(setq x2 (car pt2))
(setq y2 (cadr pt2))
(setq x3 (car pt3))
(setq y3 (cadr pt3))
(if (< x3 x2) (setq x4 (- x2 (* ts 7))))
(if (> x3 x2) (setq x4 (+ x2 (* ts 7))))
(setq y4 y2)
(setq pt4 ( list x4 y4))
; (command “line” pt2 pt4 “”)
(setq x1 (/ (+ x2 x4) 2))
(setq X_coord ax )
(setq Y_coord ay )
; (xy_dcl)
(setq dcl_id (load_dialog “xy.dcl”))
(new_dialog “coordXY” dcl_id)
;;; 커서의 포커스를 fronttext 창으로 설정한다.
(set_tile “X_coord” X_coord)
(set_tile “Y_coord” Y_coord)
(ok_func)
(start_dialog)
(done_dialog)
(unload_dialog dcl_id)
(princ)
(setq ax X_coord) ; 값을 전달한다.
(setq ay Y_coord) ; 값을 전달한다.
;****** X 좌표 string
(setq y1 (+ y2 (* 1.2 ts)))
(setq pt1 (list x1 y1))
(command “text” “j” “tc” pt1 ts 0 ax)
;****** Y 좌표 string
(setq y1 (- y2 (* 1.2 ts)))
(setq pt2 (list x1 y1))
(command “text” “j” “bc” pt2 ts 0 ay)
)
(defun ok_func()
;;; 데이터가 들어오면 fronttext, tailtext 변수에 저장한다.
(action_tile “X_coord” “(setq X_coord $value)”)
(action_tile “Y_coord” “(setq Y_coord $value)”)
)