本帖最后由 lee50310 于 2021-10-28 03:33 编辑
- ;by lee50310
- ;--------------------------------------------------------------------------
- (defun c:tt2( / ss lst oLL oUR)
- (setq wel nil)
- (setq ss(ssget (list (cons 62 1)(cons 70 1)))) ;過濾封閉紅色框
- (setq lst (change_list ss))
- (foreach x lst
- (obb x)
- (setq wel (cons (list oLL oUR) wel))
- )
- )
- ;;------------------------------------------------------------------------
- ;;物體最小邊界框
- (defun obb (ent); = Object's Bounding Box corners
- (vla-getboundingbox (vlax-ename->vla-object ent) 'minpt 'maxpt)
- (setq
- oLL (vlax-safearray->list minpt); Object's Lower Left
- oUR (vlax-safearray->list maxpt); Object's Upper Right
- ); setq
- ); defun -- obb
- ;;------------------------------------------------------------------------
- ;將集合物轉圖元名稱表
- (defun change_list (ss)
- (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
- )
- ;;------------------------------------------------------------------------
|