(defun c:getBbox()
(vl-load-com)
;;获取指针,固定代码
(setq ZZZ (vla-get-utility(vla-get-activedocument(vlax-get-acad-object))))
(vla-getentity ZZZ 'obj 'ip "\n选择对象: ")
(vla-GetBoundingBox obj 'minpoint 'maxpoint)
;;转换为表
(setq minpoint (vlax-safeArray->list minpoint)) ;转换边界最小点
(setq maxpoint (vlax-safeArray->list maxpoint)) ;转换边界最大点
(princ minpoint)
(terpri)
(princ maxpoint)
(command "_rectang" minpoint maxpoint) ;最大外形画方形框
(princ)
)
---------------------
《伙计百科》版权所有。
源地址:http://huojibk.com/2021/11/1057.html