如何避免在activex autocad api上的SendCommand期间保存提示

问题描述 投票:0回答:1

我想将.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)

在此命令期间保存提示即将到来。我需要覆盖它,并使用这个命令saveprompt保存文件

python-3.x python-2.7 autocad autocad-plugin
1个回答
1
投票

我建议如下:

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")

请注意,这假定该文件尚不存在(否则会有一个额外的提示要考虑 - 因此您可能希望合并其他代码以考虑此方案。

© www.soinside.com 2019 - 2024. All rights reserved.