收集的功能,跟楼主要求类似,不过不是画云线,是画圆。很久不玩lisp了
- (defun c:czwz ()
- (setvar "cmdecho" 0)
- (command "undo" "be")
- (setq stxt (getstring "\n输入或点取要查找的文字<点取> :"))
- (if (and (= stxt "")
- (setq s1 (entsel "\n选择要查找的文字 :"))
- (setq ent (entget(car s1)))
- (= (cdr(assoc 0 ent)) "TEXT"))
- (setq stxt (cdr(assoc 1 (entget(car s1)))))
- )
- (if (setq ss (ssget (list '(0 . "TEXT") (cons 1 (strcat "*" stxt "*"))))) (progn
- (setq i 0)
- (repeat (sslength ss)
- (setq en (ssname ss i))
- (vla-getboundingbox(vlax-ename->vla-object en) 'minp 'maxp)
- (setq minp (vlax-safearray->list minp)
- maxp (vlax-safearray->list maxp))
- (setq pt (polar minp (angle minp maxp) (/ (distance minp maxp) 2)))
- (entmake (list '(0 . "CIRCLE") (cons 8 "FindText")(cons 62 6)(cons 10 pt) (cons 40 (/ (distance minp maxp) 2))))
- (setq i (1+ i))
- )
- (princ)
- ))
- (command "undo" "end")
- (setvar "CMDECHO" 1)
- (princ)
- )
|