CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2023 开发者帮助

XRefFadeIntensity 属性 (ActiveX)

2024-5-18 18:58| 发布者: admin| 查看: 152| 评论: 0|原作者: admin|来自: AutoCAD

XRefFadeIntensity 属性 (ActiveX)

控制 XRefs 的调光强度。

支持的平台:仅限 Windows

签名

VBA:

object.XRefFadeIntensity
对象

类型:首选项显示

此属性应用于的对象。

属性值

只读:

类型:

从 1 到 90 的正长整数,表示 XRefs 的衰落百分比。

言论

此属性的初始值为 50。

注意:此属性的值存储在 XFADECTL 系统变量中。

例子

VBA:

Sub Example_XRefFadeIntensity()
    ' This example reads and modifies the preference value that controls
    ' the dimming intensity for xrefs. When finished, this example resets
    ' the preference value back to its original value.
    '
    ' * Note: Changes can only be observed when in-place editing of an Xref
    ' object is in progress and other entities are visible.
    
    Dim ACADPref As AcadPreferencesDisplay
    Dim originalValue As Variant, newValue As Variant
    
    ' Get the display preferences object
    Set ACADPref = ThisDrawing.Application.preferences.DISPLAY
    
    ' Read and display the original value
    originalValue = ACADPref.XRefFadeIntensity
    MsgBox "The XRefFadeIntensity preference is: " & originalValue

    ' Modify the XRefFadeIntensity preference by setting it to 75
    ACADPref.XRefFadeIntensity = 75
    newValue = ACADPref.XRefFadeIntensity
    ThisDrawing.Regen acAllViewports
    
    MsgBox "The XRefFadeIntensity 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.XRefFadeIntensity = originalValue
    ThisDrawing.Regen acAllViewports
    
    MsgBox "The XRefFadeIntensity preference was reset back to: " & originalValue
End Sub

可视化 LISP:

(vl-load-com)
(defun c:Example_XRefFadeIntensity()
    ;; This example reads and modifies the preference value that controls
    ;; the dimming intensity for xrefs. When finished, this example resets
    ;; the preference value back to its original value.
    ;;
    ;; * Note: Changes can only be observed when in-place editing of an Xref
    ;; object is in progress and other entities are visible.
    (setq acadObj (vlax-get-acad-object))
    (setq preferences (vla-get-Preferences acadObj))
    
    ;; Read and display the original value
    (setq originalValue (vla-get-XRefFadeIntensity (vla-get-Display preferences)))
    (alert (strcat "The XRefFadeIntensity preference is: " (itoa originalValue)))

    ;; Modify the XRefFadeIntensity preference by setting it to 75
    (vla-put-XRefFadeIntensity (vla-get-Display preferences) 75)
    (vla-Regen doc acAllViewports)
    (alert (strcat "The XRefFadeIntensity preference has been set to: " (itoa (vla-get-XRefFadeIntensity (vla-get-Display preferences)))))

    ;; 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-XRefFadeIntensity (vla-get-Display preferences) originalValue)
    (vla-Regen doc acAllViewports)
    (alert (strcat "The XRefFadeIntensity preference was reset back to: " (itoa (vla-get-XRefFadeIntensity (vla-get-Display preferences)))))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2025-3-14 06:55

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部