DefaultOutputDevice 属性 (ActiveX) 
指定新布局和模型空间的默认输出设备。 支持的平台:仅限 Windows 属性值只读:不 类型:字符串 要使用的默认打印机的名称。 言论您可以指定计算机为其配置的任何打印机,以及绘图仪配置路径中的任何 PC3 文件。 如果系统上没有设备,则此属性将返回“None”。 例子VBA: Sub Example_DefaultOutputDevice()
    ' This example reads and modifies the preference value that controls
    ' the default output device for new layouts and model space.
    ' When finished, this example resets the preference value back to
    ' its original value.
    
    Dim ACADPref As AcadPreferencesOutput
    Dim originalValue As Variant, newValue As Variant
    
    ' Get the output preferences object
    Set ACADPref = ThisDrawing.Application.preferences.Output
    
    ' Read and display the original value
    originalValue = ACADPref.DefaultOutputDevice
    MsgBox "The DefaultOutputDevice preference is: " & originalValue
    ' Modify the DefaultOutputDevice preference
    ACADPref.DefaultOutputDevice = "DWG to PDF.pc3"
    newValue = ACADPref.DefaultOutputDevice
    MsgBox "The DefaultOutputDevice preference has been set to: " & newValue
    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.DefaultOutputDevice = originalValue
    MsgBox "The DefaultOutputDevice preference was reset back to: " & originalValue
End Sub
可视化 LISP: (vl-load-com)
(defun c:Example_DefaultOutputDevice()
    ;; This example reads and modifies the preference value that controls
    ;; the default output device for new layouts and model space.
    ;; When finished, this example resets the preference value back to
    ;; its original value.
    (setq acadObj (vlax-get-acad-object))
    (setq preferences (vla-get-Preferences acadObj))
    
    ;; Get the output preferences object
    (setq ACADPref (vla-get-Output preferences))
    
    ;; Read and display the original value
    (setq originalValue (vla-get-DefaultOutputDevice ACADPref))
    (alert (strcat "The DefaultOutputDevice preference is: " originalValue))
    ;; Modify the DefaultOutputDevice preference
    (vla-put-DefaultOutputDevice ACADPref "DWG to PDF.pc3")
    (setq newValue (vla-get-DefaultOutputDevice ACADPref))
    (alert (strcat "The DefaultOutputDevice preference has been set to: " newValue))
    ;; Reset the preference back to its original value
    ;;
    ;; * Note: Comment out this last section to leave the change to
    ;;         this preference in effect
    (vla-put-DefaultOutputDevice ACADPref originalValue)
    (alert (strcat "The DefaultOutputDevice preference was reset back to: " originalValue))
)
 | 
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1   苏公网安备32011402011833)
GMT+8, 2025-11-4 15:10
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.