Jump to content

ExportToAutocad: Stop Prompts to Overwrite File?!


C4D_M4N

Recommended Posts

I'm am attempting to export models from Plant 3D using ExportToAutoCAD. However, I don't want to be prompted as to whether I want to overwrite, I just want it to save these files out, whether the file exists or not.

 

My lisp skills are sorely lacking but I thought I might try this statement, but my syntax is incorrect:

 

((if(findfile DWGN2))(command "-EXPORTTOAUTOCAD" "2010" DWGN2 "y")(command "-EXPORTTOAUTOCAD" "2010" DWGN2))

 

What is the correct way to write this?

 

There is probably much better way to accomplish this task so any help would be much appreciated!

 

Thanks,

Mitch

Link to comment
Share on other sites

Hi Mitch, and welcome to CADTutor.

 

Firstly, I would recommend that you read the Code Posting Guidlines, so that you know how to format code for future posts.

 

Now, regarding the code, assuming the variable DWGN2 contains a valid filename, I think:

 

(if (findfile DWGN2)
   (command "_.-exporttoautocad" "_F" "2010" "" DWGN2 "_Y")
   (command "_.-exporttoautocad" "_F" "2010" "" DWGN2)
)

 

Note, however, that this doesn't allow for the case in which the filename already exists and is in use.

Link to comment
Share on other sites

  • 1 year later...

Ok this works, but how to overwrite the file? (use same file name of the file that the lisp is used at)

 

This should be done using script so one could create new file with suffix or prefix, than close the file, delete original, rename new file to old file name and reopen it...

anybody knows how to script it?

and batch ...?

 

Oh, and more important of all,

how to prevent loss of page setups and named views when using the exporttoautocad command?!

The loss of above is bloody irritating....

 

this is what i use to avoid all the dialogs

 

(command "-exporttoautocad" "_F" "2013" "_B" "N" "_T" "I" "_M" "N" "_P" "1_" "_S" "." "" "")

it produces the file in 2013 format, no xrefs binded, with 1_ prefix in file name.

Edited by ibach
Link to comment
Share on other sites

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