Plots a layout to the specified file.
Supported platforms: Windows only
VBA:
RetVal = object.PlotToFile(plotFile [, plotConfig])
Type: Plot
The object this method applies to.
Access: Input-only
Type: String
The name of the file to plot the active layout to. If you plot multiple layouts, the file name for each plot will be generated from the drawing and layout names.
Access: Input-only; optional
Type: String
The full path and file name of the PC3 file to use instead of the current configuration. If this parameter is not provided, the current configuration will be used.
Type: Boolean
The drawing from which the plot is initiated must be active for the plot to succeed.
To plot in the foreground, you must set the AutoCAD BACKGROUNDPLOT system variable to 0. Otherwise, plotting occurs in the background.
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. 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 a file extension is provided in the plotFile parameter, that extension will almost always be used for the output plot file. The specified extension will be overwritten only for certain raster output drivers that replace user-provided extensions with .gif.
If a file extension is not provided in the plotFile parameter, an extension is automatically generated for the output plot file based on the default extension for the specified driver or device.
For some plotters, the output format you choose determines the file extension and whether the plot is written to a file. Also, some plotters might not be able to plot to a file. For further information, see the AutoCAD Online Help system or the plotter's manual from the manufacturer.
VBA:
Sub Example_PlotToFile() ' This example sends a plot of the current drawing ' to a file. ThisDrawing.ActiveLayout.ConfigName = "DWF6 ePlot.pc3" ' Define the output file name. ' Use "" to use the drawing name as the file name. Dim plotFileName As String plotFileName = "MyPlot" Dim result As Boolean result = ThisDrawing.Plot.PlotToFile(plotFileName) End Sub
Visual LISP:
(vl-load-com) (defun c:Example_PlotToFile() ;; This example sends a plot of the current drawing ;; to a file. (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) ;; Set a device current that outputs to a file (vla-put-ConfigName (vla-get-ActiveLayout doc) "DWF6 ePlot.pc3") ;; Define the plot variable (setq currentPlot (vla-get-Plot doc)) ;; Define the output file name. ;; Use "" to use the drawing name as the file name. ;; Note: if the file name exists an error will be generated. (setq plotFileName "MyPlot") (vla-PlotToFile currentPlot plotFileName) )