本帖最后由 lee50310 于 2020-2-18 23:59 编辑
來源位置:https://forum.bricsys.com/discussion/33192/overkill-in-lisp-routine
試試這段代碼, 可完全删除重叠图元
 - ;;圈选范围,删除重叠图元
- ;;
- (defun c:Test (/ ss item)
- (if (setq ss (ssget))
- (progn
- (command "-overkill" ss "" "Ignore" "lweight" "Ignore" "Layer" "")
- (foreach item (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
- (if (not (entget item))
- (setq ss (ssdel item ss))
- )
- )
- )
- )
- (princ)
- )
|