Files
revitDwgImportCleaner/source scripts/bindAndDetachXrefs.lsp

21 lines
473 B
Common Lisp

;; bindAndDetachXrefs.lsp
;;
;; bind and detach all xrefs, detach missing
;;
;; Created by Peter Gyetvai
;; gyetpet@mailbox.org
(defun C:bindAndDetachXrefs (/ blk)
(graphscr)
(foreach x
(mapcar 'cadr (ssnamex (ssget "_X" '((0 . "INSERT") (410 . "MODEL")))))
(setq blk (cdr (assoc 2 (entget x))))
(if (assoc 1 (tblsearch "block" blk))
(progn
(command "_.-xref" "_bind" blk)
(command "_.-xref" "_detach" blk)
)
)
)
)