Added option to open file after export
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
*._ls
|
||||||
@@ -346,18 +346,41 @@
|
|||||||
(vl-load-com)
|
(vl-load-com)
|
||||||
(setq prefix (getvar "dwgprefix"))
|
(setq prefix (getvar "dwgprefix"))
|
||||||
(setq basefilename (getvar "dwgname"))
|
(setq basefilename (getvar "dwgname"))
|
||||||
|
(setq filename(vl-string-right-trim ".dwg" basefilename))
|
||||||
|
|
||||||
|
; file path lengths
|
||||||
(setq fn1 (strlen (getvar "dwgprefix")))
|
(setq fn1 (strlen (getvar "dwgprefix")))
|
||||||
(setq fn2 (strlen (getvar "dwgname")))
|
(setq fn2 (strlen (getvar "dwgname")))
|
||||||
(setq fullength (+ fn1 fn2 5 8))
|
(setq fullength (+ fn1 fn2 5 8))
|
||||||
|
|
||||||
(if (> fullength 255)
|
(if (> fullength 255)
|
||||||
(progn
|
(progn
|
||||||
(setq prefix (strcat (getenv "USERPROFILE") "\\Desktop"))
|
(setq prefix (strcat (getenv "USERPROFILE") "\\Desktop"))
|
||||||
(setq filename(vl-string-right-trim ".dwg" basefilename))
|
(setq savepath (strcat prefix "ACAD-" filename "_cleaned.dwg" ))
|
||||||
(setq savepath (strcat prefix "\\ACAD-" filename "_cleaned.dwg" ))
|
|
||||||
(command "._-AECEXPORTTOAUTOCAD" "f" "2013" "" savepath)
|
(command "._-AECEXPORTTOAUTOCAD" "f" "2013" "" savepath)
|
||||||
(print "Too long filename, saved to desktop!")
|
(print "Too long filename, saved to desktop!")
|
||||||
|
(savepath)
|
||||||
|
)
|
||||||
|
(progn
|
||||||
|
(command "._-AECEXPORTTOAUTOCAD" "f" "2013" "s" "_cleaned" "" "")
|
||||||
|
(strcat prefix "ACAD-" filename "_cleaned.dwg")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
; ------------------------------- openExported ------------------------------- ;
|
||||||
|
|
||||||
|
(defun openExported (path / openit )
|
||||||
|
(initget 1 "Yes No")
|
||||||
|
(setq openit (getkword "Open exported file? [Yes/No]"))
|
||||||
|
(if
|
||||||
|
(= openit "Yes")
|
||||||
|
(progn
|
||||||
|
(print (strcat "Opening document: " path))
|
||||||
|
;; (command "fileopen" path)
|
||||||
|
(vla-activate (vla-open (vla-get-documents (vlax-get-acad-object)) (strcat "\"" path "\"")))
|
||||||
)
|
)
|
||||||
(command "._-AECEXPORTTOAUTOCAD" "f" "2013" "s" "_cleaned" "" "")
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -409,4 +432,5 @@
|
|||||||
(command "._REGENALL")
|
(command "._REGENALL")
|
||||||
|
|
||||||
;; Export
|
;; Export
|
||||||
(checkedExportToAutocad)
|
(setq exportpath (checkedExportToAutocad))
|
||||||
|
(openExported exportpath)
|
||||||
Reference in New Issue
Block a user