Nithish Albin
Nithish Albin

Reputation: 23

How to avoid Save Prompt During SendCommand on activex autocad api

I am trying to convert .dwg format to png/bmp.

when I use Plot in AutoCAD for converting dwg to 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)

during this command Save prompt is coming. I need to override this and also save the file using this single commandsaveprompt

Upvotes: 0

Views: 272

Answers (1)

Lee Mac
Lee Mac

Reputation: 16015

I would suggest the following:

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

Note that this assumes that the file does not already exist (otherwise there would be an additional prompt to consider - you may therefore wish to incorporate additional code to account for this scenario.

Upvotes: 1

Related Questions