View Full Version : data extraction lisp - background save issue - Autocad

21st Nov 2013, 03:33 am

i have a lisp i have set up for the office that runs a pre-configured data extraction (dxe) file. the purpose of this lisp is to insert a table in the drawing that shows attributes from a specific block that contains a couple of attributes.

the only way i have been able to get the routine to work is to first do a background save to a specifically named file on the server (dxtemp file.dwg).. the dxe file then always references this file and for the most part works amazingly.

the issue i am having is that if a user does not first save the file they are working on - when the background (._save) happens, it opens the dxtemp file.dwg on their screen which in turn means that on occasions where this happens, someone else is unable to run the command as the dxtemp file is already open.

i ask if anyone knows a way to make the ._save always background, even if the file running it has not previously been saved - ie still called Drawing1.dwg etc.

here is my current code

(defun c:Atable (/ pt1)

(SETVAR "cmdecho" 0)
(command "._save" "V:/E-Library/Autocad/02 ACAD Settings/data extraction/DXTEMP FILE.dwg" "y")
(princ "\nSelect point to insert table")
(setq pt1 (getpoint))
(command "-dataextraction" "V:/E-Library/Autocad/02 ACAD Settings/data extraction/DATAEXTRACT.dxe" pt1)
(dictremove (namedobjdict) "ACAD_DATALINK")