The code is generating an incorrect data type as a linear unit (in this case, it is foot-inch based) instead of the SAVEFORMAT variable desired:
"1" - for 2018 DWG and
"26" for R11/12 ASCII DXF.
Can you review and provide instruction?
Note: It is critical to save to the R11/12 ASCII DXF file format for compatibility purposes.
CODE START
;File: ToggleSaveFormat.lsp
;ToggleSaveFormat - Toggles the file type between Release 11/12 ASCII DXF and 2018 DWG file formats.
;Source: AI
;By: Clint Hill
;Creation Date: August 08, 2024;
;------------------------------------------------------------------------
;
(defun c:ToggleSaveFormat (/ currentSaveFormat)
;; Get the current value of the SAVEFORMAT variable
(setq currentSaveFormat (getvar "SAVEFORMAT"))
;; Check if the current value is 1, and set it to 26, or vice versa
(if (= currentSaveFormat "1")
(setvar "SAVEFORMAT" "26")
(setvar "SAVEFORMAT" "1")
)
;; Print the new SAVEFORMAT value to the command line
(princ (strcat "\nSAVEFORMAT set to: " (rtos (getvar "SAVEFORMAT"))))
(princ)
)
CODE END
Thanks,
Clint