ADCInsertUnitsDefaultSource プロパティ(ActiveX)

DesignCenter 内の、挿入単位が割り当てられていない挿入元図面のオブジェクトに対して、自動的に使用する単位を決定します。

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

構文と要素

VBA:

object.ADCInsertUnitsDefaultSource
object

タイプ: PreferencesUser

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

プロパティの値

読み込み専用: いいえ

タイプ: acInsertUnits 列挙型

注意

このプロパティの初期値は acInsertUnitsUnitless です。

注: このプロパティの値は、システム変数 INSUNITSDEFSOURCE に格納されます。

VBA:

Sub Example_ADCInsertUnitsDefaultSource()
    ' This example reads and modifies the ADCInsertUnitsDefaultSource
    ' preference value.
    ' When finished, this example resets the preference value back to
    ' its original value.
    
    Dim ACADPref As AcadPreferencesUser
    Dim originalValue As Integer, newValue As Integer
    
    ' Get the user preferences object

    Set ACADPref = ThisDrawing.Application.preferences.User
    
    ' Read and display the original value
    originalValue = ACADPref.ADCInsertUnitsDefaultSource
    MsgBox "The ADCInsertUnitsDefaultSource preference is set to: " & originalValue

    ' Modify the ADCInsertUnitsDefaultSource preference by toggling the value
    ACADPref.ADCInsertUnitsDefaultSource = acInsertUnitsMillimeters

    MsgBox "The ADCInsertUnitsDefaultSource preference has been set to: " & ACADPref.ADCInsertUnitsDefaultSource

    ' Reset the preference back to its original value
    ACADPref.ADCInsertUnitsDefaultSource = originalValue
    MsgBox "The ADCInsertUnitsDefaultSource preference was reset back to: " & originalValue
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_ADCInsertUnitsDefaultSource()
    ;; This example reads and modifies the ADCInsertUnitsDefaultSource
    ;; preference value.
    ;; When finished, this example resets the preference value back to
    ;; its original value.
    (setq acadObj (vlax-get-acad-object))

    ;; Get the user preferences object
    (setq pref (vla-get-Preferences acadObj))
    (setq user (vla-get-User pref))
    
    ;; Read and display the original value
    (setq originalValue (vla-get-ADCInsertUnitsDefaultSource user))
    (alert (strcat "The ADCInsertUnitsDefaultSource preference is set to: " (itoa originalValue)))

    ;; Modify the ADCInsertUnitsDefaultSource preference by toggling the value
    (vla-put-ADCInsertUnitsDefaultSource user acInsertUnitsMillimeters)
    (alert (strcat "The ADCInsertUnitsDefaultSource preference has been set to: " (itoa (vla-get-ADCInsertUnitsDefaultSource user))))

    ;; Restore the preference back to its original value
    (vla-put-ADCInsertUnitsDefaultSource user originalValue)
    (alert (strcat "The ADCInsertUnitsDefaultSource preference was restored back to: " (itoa originalValue)))
)