我想将.dwg格式转换为png / bmp。
当我在AutoCAD中使用Plot将dwg转换为png时。
plot_command = "-PLOT yes base1\r\nPublishToWeb PNG.pc3\rSun Hi-Res (1600.00 x 1280.00 Pixels)\rP\rN\rE\rF\rC\rY\r.\rY\rN\rN\rN\r\n& 'D:/autocad_test/see.png'& \r\n"
doc.SendCommand(plot_command)
我建议如下:
doc.SendCommand("_.filedia\n0\n_.-plot\n_Y\n\nPublishToWeb PNG.pc3\nSun Hi-Res (1600.00 x 1280.00 Pixels)\n_P\n_N\n_E\n_F\n_C\n_Y\n.\n_Y\n_N\n_N\n_N\nD:/autocad_test/see.png\n_N\n_Y\n_.filedia\n1\n")
请注意,这假定该文件尚不存在(否则会有一个额外的提示要考虑 - 因此您可能希望合并其他代码以考虑此方案。