给文字加圆加点,但是参数太少,源码龙龙仔
找了半天也没找出来,有人指教一下不?;;By 龙龙仔(LUCAS),Modified by meflying;;在TEXT和MTEXT实体的几何中心点画点
;;参数:sname - 文字对象名
(vl-load-com)
(defun c:TT (sname / CENTPT N)
(defun AX:GETBOUNDINGBOX (ENT / LLURentsents2)
(setq ents (entget ent))
(if (= (cdr (assoc 0 ents)) "MTEXT")
(progn
(setq ents2 ents)
(setq ents2 (subst (cons 41 0) (assoc 41 ents2) ents2))
(entmod ents2)
)
)
(vla-getboundingbox (vlax-ename->vla-object ENT) 'LL 'UR)
(entmod ents)
(MIDPOINT (vlax-safearray->list LL)
(vlax-safearray->list UR)
)
)
(defun MIDPOINT (/ PT1 PT2)
(mapcar
'(lambda (X Y)
(* 0.5 (+ X Y))
)
PT1 PT2
)
)
(setq CENTPT (AX:GETBOUNDINGBOX sname))
(command "_.point" centpt) ; 生成点
;(entmakex (list '(0 . "CIRCLE") (cons 10 centpt) (cons 40 1) )) ; 生成圆
(princ)
)
(defun TT (sname / CENTPT N)
(defun AX:GETBOUNDINGBOX (ENT / LLURentsents2)
(setq ents (entget ent))
(if (= (cdr (assoc 0 ents)) "MTEXT")
(progn
(setq ents2 ents)
(setq ents2 (subst (cons 41 0) (assoc 41 ents2) ents2))
(entmod ents2)
)
)
(vla-getboundingbox (vlax-ename->vla-object ENT) 'LL 'UR)
(entmod ents)
(MIDPOINT (vlax-safearray->list LL)(vlax-safearray->list UR))
)
(defun MIDPOINT (PT1 PT2 / PT1 PT2)
(mapcar
'(lambda (X Y)
(* 0.5 (+ X Y))
)
PT1 PT2
)
)
(setq CENTPT (AX:GETBOUNDINGBOX sname))
(entmakex (list '(0 . "POINT") (cons 10 centpt) )) ; 生成点
(entmakex (list '(0 . "CIRCLE") (cons 10 centpt) (cons 40 1) )) ; 生成圆
(princ)
)
(TT (car(entsel))) 飞雪神光 发表于 2023-6-3 11:59
谢谢,可以使用了! 不错的帖子 顶一下 {:1_1:}{:1_1:}:(
不錯的帖子頂一下 學習
页:
[1]