CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2025 开发者帮助

IncrementalSavePercent 属性 (ActiveX)

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

IncrementalSavePercent 属性 (ActiveX)

指定图形文件中允许的浪费空间的百分比。

支持的平台:仅限 Windows

签名

VBA:

object.IncrementalSavePercent
对象

类型:PreferencesOpenSave

此属性应用于的对象。

属性值

只读:

类型:整数

有效范围为 0 到 100。

言论

此属性的初始值为 50。

当达到指定的百分比时,AutoCAD 将执行完全保存,而不是增量保存。完整保存消除了空间浪费。如果将此属性设置为 0,则每次保存都是一次完整保存。

尽管增量保存会增加图形的大小,但不要设置非常低的值。为获得最佳性能,请将该值设置为 50。如果内存成为问题,请将值设置为 25。如果将该值设置为 20 或更小,则性能会显著降低。较低的值会降低程序的性能,因为 AutoCAD 会更频繁地执行耗时的完全保存。

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

例子

VBA:

Sub Example_IncrementalSavePercent()
    ' This example returns the current setting of
    ' IncrementalSavePercent. It then changes the value, and finally
    ' it resets the value back to the original setting.
    
    Dim preferences As AcadPreferences
    Dim currIncrementalSavePercent As Integer
    Dim newIncrementalSavePercent As Integer
    
    Set preferences = ThisDrawing.Application.preferences
    
    ' Retrieve the current IncrementalSavePercent value
    currIncrementalSavePercent = preferences.OpenSave.IncrementalSavePercent
    MsgBox "The current value for IncrementalSavePercent is " & currIncrementalSavePercent, vbInformation, "IncrementalSavePercent Example"
    
    ' Change the value for IncrementalSavePercent
    newIncrementalSavePercent = 20
    preferences.OpenSave.IncrementalSavePercent = newIncrementalSavePercent
    MsgBox "The new value for IncrementalSavePercent is " & newIncrementalSavePercent, vbInformation, "IncrementalSavePercent Example"
    
    ' Reset IncrementalSavePercent to its original value
    preferences.OpenSave.IncrementalSavePercent = currIncrementalSavePercent
    MsgBox "The IncrementalSavePercent value is reset to " & currIncrementalSavePercent, vbInformation, "IncrementalSavePercent Example"
End Sub

可视化 LISP:

(vl-load-com)
(defun c:Example_IncrementalSavePercent()
    ;; This example returns the current setting of
    ;; IncrementalSavePercent. 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 IncrementalSavePercent value
    (setq currIncrementalSavePercent (vla-get-IncrementalSavePercent (vla-get-OpenSave preferences)))
    (alert (strcat "The current value for IncrementalSavePercent is " (itoa currIncrementalSavePercent)))
    
    ;; Change the value for IncrementalSavePercent
    (setq newIncrementalSavePercent 20)
    (vla-put-IncrementalSavePercent (vla-get-OpenSave preferences) newIncrementalSavePercent)
    (alert (strcat "The new value for IncrementalSavePercent is " (itoa (vla-get-IncrementalSavePercent (vla-get-OpenSave preferences)))))
    
    ;; Reset IncrementalSavePercent to its original value
    (vla-put-IncrementalSavePercent (vla-get-OpenSave preferences) currIncrementalSavePercent)
    (alert (strcat "The IncrementalSavePercent value is reset to " (itoa currIncrementalSavePercent)))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2025-1-19 06:43

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部