本帖最后由 琴剑江山_10184 于 2015-11-29 20:22 编辑
- (defun C:JQ (/ A B DD EN ENT LEN OS P1 P2 PL PP SS)
- (setvar "cmdecho" 0)
- (setq os (getvar 'osmode))
- (setvar 'osmode 0)
- (setq dd (getdist "\n 输入字间与圆周距离<2>: "))
- (if (null dd)
- (setq dd 2.0)
- )
- (setq ss (ssget '((0 . "TEXT")))
- Len (sslength ss)
- )
- (repeat Len
- (setq en (ssname ss (setq Len (1- Len))))
- (vl-cmdf "ucs" "OB" en)
- (setq ent (entget en)
- pp (textbox ent)
- p1 (car pp)
- p2 (cadr pp)
- pL (mapcar '(lambda (a b) (/ (+ a b) 2)) p1 p2)
- dr (+ (/ (distance p1 p2) 2) dd)
- )
- (command "circle" pL dr)
- )
- (vl-cmdf "ucs" "W")
- (setvar 'osmode os)
- (prin1)
- )
|