CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

PlotToFile Method (ActiveX)

2023-1-4 05:03| 发布者: admin| 查看: 1109| 评论: 0|来自: AutoCAD

摘要: 将布局打印到指定的文件。

将布局打印到指定的文件。

支持的平台:仅窗口

签名

工 务 局:

RetVal = object.PlotToFile(plotFile [, plotConfig])
对象

类型:剧情

此方法适用的对象。

打印文件

访问:仅输入

类型:字符串

要将活动布局打印到的文件的名称。如果打印多个布局,将根据图形和布局名称生成每个打印的文件名。

plotConfig

访问:仅输入;自选

类型:字符串

要使用的 PC3 文件的完整路径和文件名,而不是当前配置。如果未提供此参数,则将使用当前配置。

返回值(RetVal)

类型:布尔

  • True:绘图已成功发送到文件。
  • False:打印未发送到文件。要么是绘图过程失败,要么是绘图被取消。

言论

从中启动绘图的图形必须处于活动状态,绘图才能成功。

要在前台打印,必须将 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)
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-5-12 05:00

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部