Jump to content

Recommended Posts

Posted

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

Posted

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 .

Posted
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

Posted

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.

Posted

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...

  • 1 year later...
Posted
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]))

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...