CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

RegenerateTableSuppressed Property (ActiveX)

2023-1-3 07:33| 发布者: admin| 查看: 1663| 评论: 0|来自: AutoCAD

摘要: 启用或禁用表块的再生。

启用或禁用表块的再生。

支持的平台:仅窗口

签名

工 务 局:

object.RegenerateTableSuppressed
对象

类型:桌子

此属性适用的对象。

属性值

只读:

类型:布尔

  • True:禁止表的重新生成。
  • False:不禁止表的重新生成。

言论

更改 Table 对象的所有方法都执行以下操作:

  1. 在写入模式下打开表对象
  2. 根据输入参数修改表对象
  3. 关闭 Table 对象,这将重新计算该 Table

重新计算大型表会消耗大量时间和内存,因为对象是从头开始重建的。Table

为避免性能问题,在通过 API 修改大型表时,应暂时禁用对象的重新生成,然后应用修改并重新启用重新生成。Table

例子

工 务 局:

Sub Example_RegenerateTableSuppressed()
    Dim MyModelSpace As AcadModelSpace
    Dim MyTable As IAcadTable
    Dim pt(2) As Double
    Set MyModelSpace = ThisDrawing.ModelSpace
    Set MyTable = MyModelSpace.AddTable(pt, 100, 5, 5, 10)

    'Temporarily disable the recomputing of table block
    MyTable.RegenerateTableSuppressed = True

    Dim i As Integer, j As Integer
    For i = 0 To 99
        For j = 0 To 4
            Call MyTable.SetText(i, j, "my string " & i & ", " & j)
        Next j
    Next i

    'Now force the recomputing of table block
    'so that we can see the update table results
    MyTable.RegenerateTableSuppressed = False

    'You can also call RecomputeTableBlock(true) instead
    'to force the regeneration of table
    'MyTable.RecomputeTableBlock(True)
    
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_RegenerateTableSuppressed()
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))

    (setq pt (vlax-3d-point 0 0 0))
  
    (setq MyModelSpace (vla-get-ModelSpace doc))
    (setq MyTable (vla-AddTable MyModelSpace pt 100 5 5 10))

    ;; Temporarily disable the recomputing of table block
    (vla-put-RegenerateTableSuppressed MyTable :vlax-true)

    (setq i 1
          j 0)
  
    (while (>= 99 i)
        (while (>= 4 j)
            (vla-SetText MyTable i j (strcat "my string " (itoa i) ", " (itoa j)))

            (setq j (1+ j))
        )

        (setq i (1+ i)
              j 0)
    )

    ;; Now force the recomputing of table block
    ;; so that we can see the update table results
    (vla-put-RegenerateTableSuppressed MyTable :vlax-false)

    ;; You can also call (vla-RecomputeTableBlock obj :vl;ax-true) instead
    ;; to force the regeneration of table
    ;;(vla-RecomputeTableBlock MyTable :vlax-true)
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-11 17:34

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部