18 lines
794 B
Common Lisp
18 lines
794 B
Common Lisp
(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" "")
|
|
)
|
|
) |