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