changed to lsp, xref question, filename test
This commit is contained in:
@@ -5,16 +5,20 @@
|
||||
;; Created by Peter Gyetvai
|
||||
;; gyetpet@mailbox.org
|
||||
|
||||
(defun C:bindAndDetachXrefs (/ blk)
|
||||
(defun C:bindAndDetachXrefs (/ really 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)
|
||||
(initget 1 "Yes No")
|
||||
(setq really (getkword "Bind xrefs? [Yes/No]"))
|
||||
(if
|
||||
(= really "YES")
|
||||
(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)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
18
source scripts/checkedExportToAutocad.lsp
Normal file
18
source scripts/checkedExportToAutocad.lsp
Normal file
@@ -0,0 +1,18 @@
|
||||
(defun c:checkedExportToAutocad (/ prefix basefilename fn1 fn2 fullength filename savepath)
|
||||
(vl-load-com)
|
||||
(setq prefix (getvar "dwgprefix"))
|
||||
(setq basefilename (getvar "dwgname"))
|
||||
(setq fn1 (strlen (getvar "dwgprefix")))
|
||||
(setq fn2 (strlen (getvar "dwgname")))
|
||||
(setq fullength (+ fn1 fn2 5 8))
|
||||
(if (> fullength 255)
|
||||
(progn
|
||||
(setq prefix (strcat (getenv "USERPROFILE") "\\Desktop"))
|
||||
(setq filename(vl-string-right-trim ".dwg" basefilename))
|
||||
(setq savepath (strcat prefix "\\ACAD-" filename "_cleaned.dwg" ))
|
||||
(command "._-AECEXPORTTOAUTOCAD" "f" "2013" "" savepath)
|
||||
(print "Too long filename, saved to desktop!")
|
||||
)
|
||||
(command "._-AECEXPORTTOAUTOCAD" "f" "2013" "s" "_cleaned" "")
|
||||
)
|
||||
)
|
||||
Reference in New Issue
Block a user