简体   繁体   中英

"Save as" an open file from Command Line

I have a large folder of DWG files and want to convert them to DXF files, using Solid Edge. After opening the documents, is it possible to "Save As" from the command line or powershell?

Is this a program by program line of code or is it universal for all programs?
So if I wanted to save a .docx document open in Microsoft Word as a .pdf (for want of a better example) can I use that same line of code?

Any help appreciated...

Well since you want to convert from one Autocad format to another, you could do it using Autocad's command line.

https://knowledge.autodesk.com/support/autocad/downloads/caas/downloads/content/autodesk-customization-conversion-tools.html?_ga=2.88877275.1703552679.1574826072-7420195.1574826072

This does require you writing all of the scripting of course.

Alternatively, there is this handy scripted mass converter someone wrote using lisp and they wrote a custom script executor wrapper thingy but their scripting supposedly requires the full version of autocat (at least version 2010 to accomplish this.)

https://www.cadtutor.net/forum/topic/51941-autocad-mass-convert-dwg-to-dxf-batch-convert-dwg-to-dxf-mas-dwg-convert/

That said the official AutocCAD conversion command-line utilities are also going to use LISP scripting, so you might want to just take the second script, and work through it manually testing against the normal AutoCAD utilities until you can get it working for your needs to sort of jump start you.

If you do that I would suggest re-posting with tags for LISP and AutoCAD and give them a sample of what you have got if you end up going the official tools and your own or jump-started script route.

Hope that will be helpful to you and others in the future! :)

As commented beneath my question,

No, it would not be universal

So, no, there is no way of using a single command "save as" on every single program, and as Solid Edge doesn't have a command line API, that I know of, I would have to write a program for it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM