Jump to content

Script using DXFOUT & DXFIN


slovenc0417

Recommended Posts

Scenario

I have 15 .dwg files open. I set my default "save as" to .dxf format. I save all 15 drawings and now I have 30 files open. I want to close all of them without saving. The .dxf's are obviously already saved.

 

Question

Is there a way I can close all 30 files without having to answer the "Yes or No" do you want to save this file? I realize I can go to Task Manager and simply close the program, but I wanted to know if there was some kind of "kill switch" within AutoCad.

 

I am running 2013.

 

Any help would be greatly appreciated!

Link to comment
Share on other sites

I don't believe so. If you have saved, and AutoCAD hasn't performed any command of any description from then to closing, then it should close without a prompt. I have my auto-save for every minute then do a large file dump and delete, so this seldom happens for me. I don't trust my luck, lol. An auto-save requires a prompt when quiting.

Link to comment
Share on other sites

Thanks PotGuy and RobDraw for both comments.

 

I currently use CLOSEALL as that is the best option so far. I guess I am really looking for a "one-stop close 'em all without any questions" kind of command! LOL! Certainly a dangerous command if one were to exist! Maybe someone else will come along with an answer.

 

Thanks again!

Link to comment
Share on other sites

This is posted twice ?

 

Any way, someone out there ? Easy if you can find out how many dwgs are open then just use a lisp to write a script and run Close N repeated.

Link to comment
Share on other sites

I second BIGAL's comment. A lisp routine would do a good job of it.

 

Make two; one for yes and one for no?

 

I'd make one, but I don't know how.

Link to comment
Share on other sites

I have no script experience at all. I recently was guided towards Lee Mac and have picked up on a few things. I run the script writer .add-on within AutoCAD.

 

I would like to write a script that will purge some nasty line types that have infiltrated several of our drawings. However, simply purging will not do. These line types can only be purged when the .dwg in converted to a .dxf, the .dxf opened then purged and then saved back to .dwg.

 

The script I have written below would open the file in a particular folder, convert the file to a .dxf. It then would open the .dxf via DXFIN, purge all then save the drawing as a .dwg. This procedure works great when you do it manually. However, when you try to run it as a script, it breaks down after the .dxf is opened. I am sure the problem is that the script is based in the .dwg and when the .dxf is opened, there is no script in that .dxf to continue the procedure.

 

Can a script be written to accomplish this all in one fell swoop? Or do I just write two scripts, one that will multi-batch the .dwg's in to .dxf's, and another script to purge and re-save as .dwg? Two scripts is still a great time saver, but one would be awesome!!!

 

 

Finally, with all due respect please refrain from suggesting other methods of cleaning these files. It as been discussed ad nauseum in another thread. I have situations in which I would have to clean 50+ files at a time, thus the reason for wanting a script that will batch this whole process.

 

Here's the script I mentioned above...

 

_.open *file* _.filedia 0 _.dxfout O ALL _.dxfin _.-purge A N _.saveas Y _.close

 

Thanks do much for reading this short request, and as always, any help would be greatly appreciated!

Link to comment
Share on other sites

_.open *file* _.filedia 0 _.dxfout O ALL _.dxfin _.-purge A N _.saveas Y _.close

 

You need a Script file not a command macro paste into notepad and save as yourscript.SCR then from any drawing SCRIPT picking file, when using an external script you can open and close as many dwg's as you like.

 

Not tested script ps leave in extra blank line this is a press

_.open
*file*
_.filedia 0
_.dxfout O ALL
new 

_.dxfin filename
_.-purge A N 
_.saveas filename Y close


Link to comment
Share on other sites

You need a Script file not a command macro paste into notepad and save as yourscript.SCR then from any drawing SCRIPT picking file, when using an external script you can open and close as many dwg's as you like.

 

Not tested script ps leave in extra blank line this is a press

_.open
*file*
_.filedia 0
_.dxfout O ALL
new 

_.dxfin filename
_.-purge A N 
_.saveas filename Y close


 

Thank you! I look forward to trying this tomorrow. One thing. What do you mean when you say "is a press ".

Link to comment
Share on other sites

I combined two of your threads and put them in the The CUI, Hatches, Linetypes, Scripts & Macros forum.

 

Yesterday in your other related thread I suggested an automatic scripting program SMARTPURGER that had a free trial, did you even bother to try it?

 

There are also other FREE Script programs around like ScriptPro and AutoScript.

 

The AutoCAD help file goes through script creation pretty well, I believe BIGAL was telling you the last line should be blank.

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