CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2025 开发者帮助

GenerateUsageData 方法 (ActiveX)

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

GenerateUsageData 方法 (ActiveX)

生成指定图层是否正在使用的数据。

支持的平台:仅限 Windows

签名

VBA:

object.GenerateUsageData
对象

类型: 图层

此方法应用到的对象。

返回值 (RetVal)

无返回值。

言论

没有其他评论。

例子

VBA:

Sub Example_GenerateUsageData()
    ' This example provides usage information for the layers
    ' in a drawing
    Dim MyLayers As AcadLayers
    Set MyLayers = ThisDrawing.Layers
    
    MyLayers.GenerateUsageData
    
    Dim MyLayerObj As AcadLayer
    For Each MyLayerObj In ThisDrawing.Layers
        MyLayerObj.Description = "Test"
        MsgBox (MyLayerObj.Used)
    Next MyLayerObj
End Sub

可视化 LISP:

(vl-load-com)
(defun c:Example_GenerateUsageData()
    ;; This example provides usage information for the layers
    ;; in a drawing
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))

    (setq MyLayers (vla-get-Layers doc))
    (vla-GenerateUsageData MyLayers)
  
    (vlax-for MyLayerObj MyLayers
        (vla-put-Description MyLayerObj "Test")
        (alert (strcat "Layer " (vla-get-Name MyLayerObj) (if (= (vla-get-Used MyLayerObj) :vlax-true) " is used." " is not used.")))
    )
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-12-15 22:30

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部