问题
I'm quite new to AutoCAD and has been asked to write a C# utility that can convert a .dwg file to pdf. I've been googling around and haven't figured out any way yet. Do you have any suggestion?
回答1:
If you are automating AutoCAD then just simply send a command to plot the appropriate layout using the DWG to PDF.pc3
printer. You're looking for SendStringToExecute()
or SendCommand()
if you are using COM.
C# is overkill for this, even if you are batch-plotting thee are commands built into AutoCAD for this. See the AutoCAD Publish
command.
Edit in response to comment below. You should look at https://developer.autodesk.com/api/autocadio/ - it's AutoCAD as a web service.
来源:https://stackoverflow.com/questions/37536367/convert-dwg-file-to-pdf