- (defun c:dimdim (/ cline pt1 pt2 pt3 dis inp dimtext)
- (if (and (setq pt1 (getpoint "\nSelect outer point"))
- (setvar "lastpoint" pt1)
- (setq cline (cadr (entsel "\nSelect centerline"))))
- (progn
-
- (setq pt2 (osnap cline "per")
- pt3 (polar pt1 (angle pt1 pt2) (* 2 (distance pt1 pt2)))
- dis (rtos (distance pt1 pt3) 2 2))
- (Initget "Yes No")
- (setq inp
- (getkword
- (strcat "\nEnter distance (" dis ") with %%c <Yes/No> : ")))
- (cond
- ((member inp '("Yes" nil ""))(setq dimtext (strcat "%%c" dis)))
- (t (setq dimtext dis)))
- (command "dim1" "al" pt1 pt3 pause dimtext)
-
- )
- )
- )
试试看。。。
gr.Rlx |