本帖最后由 jun353835273 于 2020-4-22 23:40 编辑
实际用处不是很大
知道里帮人回答了一个,但刚刚看怎么消失了。
- (defun c:T2( / ss rete ent pt ptm i n)
- (setvar "cmdecho" 0)
- (princ "选择要添加的矩形图框:")
- (setq ss (ssget (LIST '(0 . "LWPOLYLINE") )));'(8 . "打印框") '(70 . 1)
- (setq rate (getstring "\n输入公司名称:"))
- (if (and rate(/= rate ""))
- (progn
- (setq n 0)
- (repeat (sslength ss)
- (setq ent (ssname ss n))
- (setq pt (getminpo ent ))
- (setq ptm pt)
- (setq i 1)
- (repeat 5
- (setq pt (polar ptm (* 0.5 pi) (* i 40)))
- (entmaketxt pt rate)
- (repeat 5
- (setq pt (polar pt 0 100))
- (entmaketxt pt rate)
- )
- (setq i (+ 1 i))
- )
- (setq n (1+ n))
- )
- )
- (princ "公司名不能为空")
- )
- (princ)
- )
- (defun getminpo (en / obj11 maxpo minpo ptmid )
- (setq Obj (vlax-ename->vla-object en))
- (vla-GetBoundingBox Obj 'minpo 'maxpo)
- (setq minpo(vlax-safearray->list minpo)
- maxpo(vlax-safearray->list maxpo))
- minpo
- )
- (defun entmaketxt(pt txt)
- (entmake(list(cons 0 "TEXT")(cons 10 pt)(cons 40 3 )(cons 1 txt) (cons 50 0.785398)))
- )
|