把斜杆后面的lst1和lst2删掉不就行了?
- (defun K:GetCenter (ss / i obj llp urp)
- (repeat (setq i (sslength ss))
- (setq obj (vlax-ename->vla-object (ssname ss (setq i (1- i)))))
- (if (and (vlax-method-applicable-p obj 'getboundingbox)
- (not (vl-catch-all-error-p
- (vl-catch-all-apply 'vla-getboundingbox (list obj 'llp 'urp)))
- )
- )
- (setq ls1 (mapcar 'min (vlax-safearray->list llp) (cond (ls1) ((vlax-safearray->list llp))))
- ls2 (mapcar 'max (vlax-safearray->list urp) (cond (ls2) ((vlax-safearray->list urp))))
- )
- )
- );获取对象最大矩形边界框左下角和右上角的WCS坐标
- )
|