马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
- (defun c:bb1(/ mydoc myhndl myobj llpoint urpoint)
- (setq s1(ssget "c"))
- (setq n 0)
- (repeat (sslength s1)
- (vl-load-com)
- (setq mydoc(vla-get-activedocument (vlax-get-acad-object)))
- (setq e(ssname s1 n)
- (setq ppp(entget e))
- (setq myname(cdr (assoc 8 ppp)))
- (setq myhndl(cdr (assoc 5 ppp)))
-
- (setq myobj(vla-handletoobject mydoc myhndl))
- (setq err(vl-catch-all-apply 'vla-getboundingbox (list myobj 'llpoint 'urpoint)))
- (if (vl-catch-all-error-p err)
- (princ "\n所选图元不能建立包容方框,程序将退出!")
- (progn
- (setq a1(vlax-safearray->list llpoint))
- (setq a2(vlax-safearray->list urpoint))
- (setq b1(car a1))
- (setq b2(car a2))
- (setq b3(abs(- b1 b2)))
- (setq c1(cadr a1))
- (setq c2(cadr a2))
- (setq c3(abs(- c1 c2)))
- (setq d1(caddr a1))
- (setq d2(caddr a2))
- (setq d3(abs(- d1 d2)))
- (princ myname)
- (princ "的尺寸为: 长: ")
-
- (princ b3)
- (princ " 宽: ")
- (princ c3)
- (princ " 高: ")
- (princ d3)
- )
- )
|