将布局打印到指定的文件。 支持的平台:仅窗口 签名工 务 局: RetVal = object.PlotToFile(plotFile [, plotConfig])
返回值(RetVal)类型:布尔
言论从中启动绘图的图形必须处于活动状态,绘图才能成功。 要在前台打印,必须将 AutoCAD 背景打印系统变量设置为 0。否则,绘图将在后台进行。 如果打印活动布局(即,在此方法之前尚未调用),则plotFile参数指定输出打印文件的名称。如果使用该方法打印多个布局,则输出打印文件将使用图形名称、布局名称和plotFile参数中提供的任何路径信息自动命名。SetLayoutsToPlotSetLayoutsToPlot 如果在plotFile参数中提供了文件扩展名,则该扩展名几乎总是用于输出绘图文件。仅对于将用户提供的扩展替换为 .gif 的某些栅格输出驱动程序,将覆盖指定的扩展模块。 如果plotFile参数中未提供文件扩展名,则会根据指定驱动程序或设备的默认扩展名为输出打印文件自动生成扩展名。 对于某些绘图仪,您选择的输出格式决定了文件扩展名以及打印是否写入文件。此外,某些绘图仪可能无法打印到文件。有关详细信息,请参阅制造商提供的 AutoCAD 联机帮助系统或绘图仪手册。 例子工 务 局: 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)
)
|
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-10-29 14:11
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.