HasExtensionDictionary プロパティ(ActiveX)

オブジェクトが、関連付けられた拡張ディクショナリを持つかどうかを決定します。

サポートされているプラットフォーム: Windows のみ

構文と要素

VBA:

object.HasExtensionDictionary
object

タイプ: すべての図形オブジェクトAttributeReferenceBlockDictionaryDimStyleGroupLayerLayoutLinetypeMaterialMLeaderStylePlotConfigurationRegisteredApplicationSectionManagerSectionSettingsSortentsTableTableStyleTextStyleUCSViewViewportXRecord

このプロパティが適用されるオブジェクト。

プロパティの値

読み込み専用: はい

タイプ: ブール型

注意

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)
        )
    )
)