快速一:
- (defun c:xrx ( / xn xr )
- (while
- (progn (setvar 'ERRNO 0) (setq xr (car (entsel "\nSelect XRef to Detach: ")))
- (cond
- ( (= 7 (getvar 'ERRNO))
- (princ "\nMissed, try again.")
- )
- ( (eq 'ENAME (type xr))
- (if
- (not
- (and
- (eq "INSERT" (cdr (assoc 0 (entget xr))))
- (= 4 (logand 4 (cdr (assoc 70 (tblsearch "BLOCK" (setq xn (cdr (assoc 2 (entget xr)))))))))
- )
- )
- (princ "\nObject is not an XRef.")
- )
- )
- )
- )
- )
- (if xr (vla-detach (vlax-ename->vla-object (cdr (assoc 330 (entget (tblobjname "BLOCK" xn)))))))
- (princ)
- )
- (vl-load-com) (princ)
|