Removed some binding parts

This commit is contained in:
2020-02-06 00:47:18 +01:00
parent edb7a19296
commit 878f127bce
2 changed files with 48 additions and 40 deletions

View File

@@ -31,25 +31,27 @@
(setq blklist (LM:Unique blklist)) (setq blklist (LM:Unique blklist))
;; Create a list of found xrefs ;; Create a list of found xrefs
(setq i 0);counter to zero ;; Removed this part, because it fails if the xrefs name differs from the filename:
(setq imax 1);while variable ;; (setq i 0);counter to zero
(while imax ;; (setq imax 1);while variable
;; (while imax
(setq xrefpath (findfile (strcat (nth i blklist) ".dwg")))
(if xrefpath ;; (setq xrefpath (findfile (strcat (nth i blklist))))
(progn ;; (if xrefpath
(setq xreflist (append xreflist (list (nth i blklist)))) ;; (progn
(princ (strcat "Xref found: " (nth i blklist) ".dwg\n")) ;; (setq xreflist (append xreflist (list (nth i blklist))))
) ;; (princ (strcat "Xref found: " (nth i blklist) ".dwg\n"))
) ;; )
;; )
(setq i (1+ i));increments i ;; (setq i (1+ i));increments i
(if (= i (length blklist)) (setq imax nil));finish function if i equals il ;; (if (= i (length blklist)) (setq imax nil));finish function if i equals il
) ;; )
;; Show prompt only if there are xrefs in the file: ;; Show prompt only if there are xrefs in the file:
(if xreflist ;; (if xreflist
(progn ;; (progn
(initget 1 "Yes No") (initget 1 "Yes No")
(setq really (getkword "Bind xrefs? [Yes/No]")) (setq really (getkword "Bind xrefs? [Yes/No]"))
(if (if
@@ -59,16 +61,18 @@
(setq imax 1);while variable (setq imax 1);while variable
(while imax (while imax
(command "_.-xref" "_bind" (nth i xreflist)) ;; (command "_.-xref" "_bind" (nth i xreflist))
(command "_.-xref" "_bind" (nth i blklist))
(setq i (1+ i));increments i (setq i (1+ i));increments i
(if (= i (length xreflist)) (setq imax nil));finish function if i equals il ;; (if (= i (length xreflist)) (setq imax nil));finish function if i equals il
(if (= i (length blklist)) (setq imax nil));finish function if i equals il
) )
) )
) )
) ;; )
(princ "No xref found in model space.") ;; (princ "No xref found in model space.")
) ;; )
) )
(defun LM:Unique ( l ) (defun LM:Unique ( l )

View File

@@ -20,25 +20,27 @@
(setq blklist (LM:Unique blklist)) (setq blklist (LM:Unique blklist))
;; Create a list of found xrefs ;; Create a list of found xrefs
(setq i 0);counter to zero ;; Removed this part, because it fails if the xrefs name differs from the filename:
(setq imax 1);while variable ;; (setq i 0);counter to zero
(while imax ;; (setq imax 1);while variable
;; (while imax
(setq xrefpath (findfile (strcat (nth i blklist) ".dwg")))
(if xrefpath ;; (setq xrefpath (findfile (strcat (nth i blklist))))
(progn ;; (if xrefpath
(setq xreflist (append xreflist (list (nth i blklist)))) ;; (progn
(princ (strcat "Xref found: " (nth i blklist) ".dwg\n")) ;; (setq xreflist (append xreflist (list (nth i blklist))))
) ;; (princ (strcat "Xref found: " (nth i blklist) ".dwg\n"))
) ;; )
;; )
(setq i (1+ i));increments i ;; (setq i (1+ i));increments i
(if (= i (length blklist)) (setq imax nil));finish function if i equals il ;; (if (= i (length blklist)) (setq imax nil));finish function if i equals il
) ;; )
;; Show prompt only if there are xrefs in the file: ;; Show prompt only if there are xrefs in the file:
(if xreflist ;; (if xreflist
(progn ;; (progn
(initget 1 "Yes No") (initget 1 "Yes No")
(setq really (getkword "Bind xrefs? [Yes/No]")) (setq really (getkword "Bind xrefs? [Yes/No]"))
(if (if
@@ -48,16 +50,18 @@
(setq imax 1);while variable (setq imax 1);while variable
(while imax (while imax
(command "_.-xref" "_bind" (nth i xreflist)) ;; (command "_.-xref" "_bind" (nth i xreflist))
(command "_.-xref" "_bind" (nth i blklist))
(setq i (1+ i));increments i (setq i (1+ i));increments i
(if (= i (length xreflist)) (setq imax nil));finish function if i equals il ;; (if (= i (length xreflist)) (setq imax nil));finish function if i equals il
(if (= i (length blklist)) (setq imax nil));finish function if i equals il
) )
) )
) )
) ;; )
(princ "No xref found in model space.") ;; (princ "No xref found in model space.")
) ;; )
) )
;; Unique - Lee Mac ;; Unique - Lee Mac