From 878f127bce4a2eeed24fbd387423a47182a14d78 Mon Sep 17 00:00:00 2001 From: infeeeee Date: Thu, 6 Feb 2020 00:47:18 +0100 Subject: [PATCH] Removed some binding parts --- revitDwgImportCleaner.lsp | 44 ++++++++++++++++++++---------------- source scripts/bindXrefs.lsp | 44 ++++++++++++++++++++---------------- 2 files changed, 48 insertions(+), 40 deletions(-) diff --git a/revitDwgImportCleaner.lsp b/revitDwgImportCleaner.lsp index b962b9c..0d16167 100644 --- a/revitDwgImportCleaner.lsp +++ b/revitDwgImportCleaner.lsp @@ -31,25 +31,27 @@ (setq blklist (LM:Unique blklist)) ;; Create a list of found xrefs - (setq i 0);counter to zero - (setq imax 1);while variable - (while imax + ;; Removed this part, because it fails if the xrefs name differs from the filename: + ;; (setq i 0);counter to zero + ;; (setq imax 1);while variable + ;; (while imax - (setq xrefpath (findfile (strcat (nth i blklist) ".dwg"))) - (if xrefpath - (progn - (setq xreflist (append xreflist (list (nth i blklist)))) - (princ (strcat "Xref found: " (nth i blklist) ".dwg\n")) - ) - ) + + ;; (setq xrefpath (findfile (strcat (nth i blklist)))) + ;; (if xrefpath + ;; (progn + ;; (setq xreflist (append xreflist (list (nth i blklist)))) + ;; (princ (strcat "Xref found: " (nth i blklist) ".dwg\n")) + ;; ) + ;; ) - (setq i (1+ i));increments i - (if (= i (length blklist)) (setq imax nil));finish function if i equals il - ) + ;; (setq i (1+ i));increments i + ;; (if (= i (length blklist)) (setq imax nil));finish function if i equals il + ;; ) ;; Show prompt only if there are xrefs in the file: - (if xreflist - (progn + ;; (if xreflist + ;; (progn (initget 1 "Yes No") (setq really (getkword "Bind xrefs? [Yes/No]")) (if @@ -59,16 +61,18 @@ (setq imax 1);while variable (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 - (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 ) diff --git a/source scripts/bindXrefs.lsp b/source scripts/bindXrefs.lsp index 15da8a0..fb7dce0 100644 --- a/source scripts/bindXrefs.lsp +++ b/source scripts/bindXrefs.lsp @@ -20,25 +20,27 @@ (setq blklist (LM:Unique blklist)) ;; Create a list of found xrefs - (setq i 0);counter to zero - (setq imax 1);while variable - (while imax + ;; Removed this part, because it fails if the xrefs name differs from the filename: + ;; (setq i 0);counter to zero + ;; (setq imax 1);while variable + ;; (while imax - (setq xrefpath (findfile (strcat (nth i blklist) ".dwg"))) - (if xrefpath - (progn - (setq xreflist (append xreflist (list (nth i blklist)))) - (princ (strcat "Xref found: " (nth i blklist) ".dwg\n")) - ) - ) + + ;; (setq xrefpath (findfile (strcat (nth i blklist)))) + ;; (if xrefpath + ;; (progn + ;; (setq xreflist (append xreflist (list (nth i blklist)))) + ;; (princ (strcat "Xref found: " (nth i blklist) ".dwg\n")) + ;; ) + ;; ) - (setq i (1+ i));increments i - (if (= i (length blklist)) (setq imax nil));finish function if i equals il - ) + ;; (setq i (1+ i));increments i + ;; (if (= i (length blklist)) (setq imax nil));finish function if i equals il + ;; ) ;; Show prompt only if there are xrefs in the file: - (if xreflist - (progn + ;; (if xreflist + ;; (progn (initget 1 "Yes No") (setq really (getkword "Bind xrefs? [Yes/No]")) (if @@ -48,16 +50,18 @@ (setq imax 1);while variable (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 - (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