The specified extension will be overwritten only for certain raster output drivers that replace user-provided extensions with. If a file extension is provided in the plotFile parameter, that extension will almost always be used for the output plot file. If you plot multiple layouts using the SetLayoutsToPlot method, the output plot files are automatically named using the drawing name, layout name, and any path information provided in the plotFile parameter. If you plot the active layout (that is, you have not called SetLayoutsToPlot before this method), the plotFile parameter specifies the name for the output plot file. Otherwise, plotting occurs in the background.
To plot in the foreground, you must set the AutoCAD BACKGROUNDPLOT system variable to 0. The drawing from which the plot is initiated must be active for the plot to succeed.