JPlanera Posted December 12, 2011 Posted December 12, 2011 I have a routine set up with GETFILED using bit code 9. If I understand this correctly, I should be able to overwrite an existing file with this set up. It is not overwriting the file I choose. It overwrites the current drawing. Any ideas? Jason Quote
Tharwat Posted December 12, 2011 Posted December 12, 2011 I think number 1 is the one which would replace the file to be re-written on it once again . Please try it to find out . Quote
JPlanera Posted December 12, 2011 Author Posted December 12, 2011 I think number 1 is the one which would replace the file to be re-written on it once again . Please try it to find out . No luck.. It still does not overwrite the file Quote
Tharwat Posted December 12, 2011 Posted December 12, 2011 Sorry , here is the explanation from the help document , and should be 32 . [b][i]32[/i][/b] (bit 5) If this bit is set and bit 0 is set (indicating that a new file is being specified), users will not be warned if they are about to overwrite an existing file. The alert box to warn users that a file of the same name already exists will not be displayed; the old file will just be replaced. Quote
JPlanera Posted December 12, 2011 Author Posted December 12, 2011 Well, it worked in the sense that the warning box did not display, but it still did not overwrite the file! Frustrating... Here is my code so far.. (DEFUN C:ARCHIVER ( / FN QF CMD) (alert "THIS COMMAND CAN NOT OVERWRITE AN\n EXISTING DRAWING. SPECIFY A NEW DRAWING NAME.") (setq CMD (getvar "cmdecho")) (setq FN (getfiled "Save Archive As" "" "dwg" 1)) (if (= FN nil ) (progn (princ)(princ "...ARCHIVER ABORTED...")(princ)) (progn (command "saveas" "" FN "") (command "-xref" "b" "*" "") (command "zoom" "e") (alert "MAKE SURE ALL XREFS HAVE BEEN BOUND.\nTYPE XREF AT THE COMMAND LINE.") (princ) (setvar "cmdecho" CMD) (command "-purge" "all" "*" "N") (COMMAND "QSAVE") ) )) So the active drawing should be saved to a NEW file and bound and purged... but if I select a drawing name that exists, the command finished in the active drawing and does not SAVE to the drawing name I selected... Quote
rayg11757 Posted July 19, 2013 Posted July 19, 2013 No luck.. It still does not overwrite the file I am thinking that if you change the getfiled flag from 1 to 9 (see code below), the save command may work with a new or existing file. See LeeMac's post in the attached cadtutor link, "I would use bit code 9 (8+1) for existing/or create new." http://www.cadtutor.net/forum/showthread.php?36805-Getfiled Hope this helps. (setq FN (getfiled "Save Archive As" "" "dwg" [b][size=4][color=purple]9[/color][/size][/b])) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.