lisp 中如何获取选中对象的最大外框矩形
1个回答
2016-11-19 · 知道合伙人软件行家
关注
展开全部
(defun c:tes ( / &k1 &kw1 &ss1 i)
(vl-load-com)
(princ "\n请选择对象")
(if (setq &kw1 (ssget))
(progn
(setq &ss1 '() i -1.0)
(while (setq &k1 (ssname &kw1 (setq i (1+ i))))
(setq &ss1 (cons &k1 &ss1))
);while
(setq &ss1 (a1611192 &ss1));对角点
(entmake (list '(0 . "CIRCLE") (cons 10 (car &ss1)) '(40 . 100)))
(entmake (list '(0 . "CIRCLE") (cons 10 (cadr &ss1)) '(40 . 100)));测试点位置
)
)
(princ)
)
;函数功能:获取最大包围框:输入由图元构成的表
(defun a1611192 (lst / lst)
(setq lst (mapcar 'a1611191 (mapcar 'vlax-ename->vla-object lst)))
(list
(list
(car (vl-sort (mapcar 'caar lst) '<))
(car (vl-sort (mapcar 'cadar lst) '<)))
(list
(car (vl-sort (mapcar 'caadr lst) '>))
(car (vl-sort (mapcar 'cadadr lst) '>))
))
)
(defun a1611191 (obj / x y)
(vla-getboundingbox obj 'x 'y)
(mapcar 'vlax-safearray->list (list x y))
)
autolisp程序获取最大包围框。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询