确定对象是否具有与其关联的扩展字典。 支持的平台:仅窗口 签名工 务 局: object.HasExtensionDictionary 属性值只读:是的 类型:布尔
言论可以为对象创建扩展字典,也可以使用该方法查询现有扩展字典。GetExtensionDictionary 例子工 务 局: Sub Example_HasExtensionDictionary() ' This example will iterate through each object in the current drawing and ' determine whether that object has an associated Extension Dictionary Dim DrawingObject As AcadObject Dim ExtensionDictionaryResults As String ' Make sure this drawing contains objects before continuing If ThisDrawing.ModelSpace.count = 0 Then MsgBox "There are no objects in the current drawing." Exit Sub End If For Each DrawingObject In ThisDrawing.ModelSpace ' Determine whether object contains Extension Dictionary Select Case DrawingObject.HasExtensionDictionary Case True ExtensionDictionaryResults = ExtensionDictionaryResults & _ DrawingObject.ObjectName & _ " has an associated Extension Dictionary" & vbCrLf Case False ExtensionDictionaryResults = ExtensionDictionaryResults _ & DrawingObject.ObjectName & _ " does not have an associated Extension Dictionary" & vbCrLf End Select Next MsgBox ExtensionDictionaryResults End Sub Visual LISP: (vl-load-com) (defun c:Example_HasExtensionDictionary() ;; This example will iterate through each object in the current drawing and ;; determine whether that object has an associated Extension Dictionary (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) (setq modelSpace (vla-get-ModelSpace doc)) ;; Make sure this drawing contains objects before continuing (if (= (vla-get-Count modelSpace) 0) (alert "There are no objects in the current drawing.") (progn (setq ExtensionDictionaryResults "") (vlax-for DrawingObject modelSpace ;; Determine whether object contains Extension Dictionary (cond ((= (vla-get-HasExtensionDictionary DrawingObject) :vlax-true) (setq ExtensionDictionaryResults (strcat ExtensionDictionaryResults (vla-get-ObjectName DrawingObject) " has an associated Extension Dictionary.\n"))) ((= (vla-get-HasExtensionDictionary DrawingObject) :vlax-false) (setq ExtensionDictionaryResults (strcat ExtensionDictionaryResults (vla-get-ObjectName DrawingObject) " does not have an associated Extension Dictionary.\n"))) ) ) (alert ExtensionDictionaryResults) ) ) ) |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:47
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.