(defun c:fxl ( / def dxf ent enx lay xrf ) ;;;Lee Mac Programming 2015
(while
(progn (setvar 'errno 0) (setq ent (car (entsel "\nSelect xref: ")))
(cond
( (= 7 (getvar 'errno))
(princ "\nMissed, try again.")
)
( (null ent) nil)
( (and (= "INSERT" (cdr (assoc 0 (setq enx (entget ent)))))
(= 4 (logand 4 (cdr (assoc 70 (tblsearch "block" (setq xrf (cdr (assoc 2 enx))))))))
)
(setq xrf (strcat xrf "|*"))
(while (setq def (tblnext "layer" (null def)))
(and (setq lay (cdr (assoc 2 def)))
(wcmatch lay xrf)
(setq enx (entget (tblobjname "layer" lay))
dxf (assoc 70 enx)
)
(entmod (subst (cons 70 (boole 7 1 (cdr dxf))) dxf enx))
)
)
nil
)
( (princ "\nThe selected object is not an xref."))
)
)
)
(princ)
)
(c:fxl)

Advertisements