オブジェクトが、関連付けられた拡張ディクショナリを持つかどうかを決定します。
サポートされているプラットフォーム: Windows のみ
VBA:
object.HasExtensionDictionary
読み込み専用: はい
タイプ: ブール型
GetExtensionDictionary メソッドを使用して、オブジェクトの拡張ディクショナリを作成したり、既存の拡張ディクショナリを取得できます。
VBA:
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) ) ) )