你的代码少了个sslist 函数
分解大法求多重引线文字边框
- (defun c:tt ( / en enx ex ll pt1 pt2 ss ssn ssx ur)
- (if (setq ss (ssget '((304 . "*"))))
- (while (setq en (ssname ss 0))
- (setq enx (entmakex (entget en)))
- (command "EXPLODE" enx)
- (if (setq ssx (ssget "P"))
- (progn
- (setq ssn (ssget "p" '((0 . "*text"))))
- (setq ex (ssname ssn 0))
- (vla-getboundingbox (vlax-ename->vla-object ex) 'LL 'UR)
- (setq pt1 (vlax-safearray->list LL) ;取左下角点
- pt2 (vlax-safearray->list UR)
- ) ;取右上角点
- (command "RECTANG" "non" pt1 "non" pt2)
- (setq ssx (ssdel ex ssx))
- (entdel ex)
- )
- )
- (print (sslength ssx))
- (print "ss")
- (command "ERASE" ssx "")
- (setq ss (ssdel en ss))
- )
- )
- (princ)
- )
|