CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

打印文件属性 (ActiveX)

2023-1-3 08:00| 发布者: admin| 查看: 513| 评论: 0|来自: AutoCAD

摘要: 指定用于临时打印文件名的备用名称。

指定用于临时打印文件名的备用名称。

支持的平台:仅窗口

签名

工 务 局:

object.PrintFile
对象

类型:首选项文件

此属性适用的对象。

属性值

只读:

类型:字符串

打印文件的备用名称。输入“.”以使用默认值(当前图形名称)。输入备用打印文件的驱动器、路径和文件名。

言论

默认名称是图形的名称加上文件扩展名 .plt。

例子

工 务 局:

Sub Example_PrintFile()
    ' This example returns the current setting of
    ' PrintFile. It then changes the value, and finally
    ' it resets the value back to the original setting.
    
    Dim preferences As AcadPreferences
    Dim currPrintFile As String
    Dim newPrintFile As String
    
    Set preferences = ThisDrawing.Application.Preferences
    
    ' Retrieve the current PrintFile value
    currPrintFile = preferences.Files.PrintFile
    MsgBox "The current value for PrintFile is " & currPrintFile, vbInformation, "PrintFile Example"
    
    ' Change the value for PrintFile
    newPrintFile = "TestPrintFile.plt"
    preferences.Files.PrintFile = newPrintFile
    MsgBox "The new value for PrintFile is " & newPrintFile, vbInformation, "PrintFile Example"
    
    ' Reset PrintFile to its original value
    preferences.Files.PrintFile = currPrintFile
    MsgBox "The PrintFile value is reset to " & currPrintFile, vbInformation, "PrintFile Example"
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_PrintFile()
    ;; This example returns the current setting of
    ;; PrintFile. It then changes the value, and finally
    ;; it resets the value back to the original setting.
    (setq acadObj (vlax-get-acad-object))
    (setq preferences (vla-get-Preferences acadObj))
    
    ;; Retrieve the current PrintFile value
    (setq currPrintFile (vla-get-PrintFile (vla-get-Files preferences)))
    (alert (strcat "The current value for PrintFile is " currPrintFile))
    
    ;; Change the value for PrintFile
    (setq newValue "TestPrintFile.plt")
    (vla-put-PrintFile (vla-get-Files preferences) newValue)
    (alert (strcat "The new value for PrintFile is " newValue))
    
    ;; Reset PrintFile to its original value
    (vla-put-PrintFile (vla-get-Files preferences) currPrintFile)
    (alert (strcat "The PrintFile value is reset to " currPrintFile))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-12 09:19

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部