changed to lsp, xref question, filename test
This commit is contained in:
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