ADCInsertUnitsDefaultSource 示例

使用 VBA 以外的其它编程语言

Sub Example_ADCInsertUnitsDefaultSource()
    ' 该示例读取并修改 ADCInsertUnitsDefaultSource 参数值。
    ' 完成后,该示例将该参数值重设回其原来的值。
    
    Dim ACADPref As AcadPreferencesUser
    Dim originalValue As Integer, newValue As Integer
    
    ' 获得“用户系统配置”参数对象

    Set ACADPref = ThisDrawing.Application.preferences.User
    
    ' 读取并显示原始值
    originalValue = ACADPref.ADCInsertUnitsDefaultSource
    MsgBox "ADCInsertUnitsDefaultSource 参数设置为: " & originalValue

    ' 修改 ADCInsertUnitsDefaultSource 参数值
    ACADPref.ADCInsertUnitsDefaultSource = acInsertUnitsMillimeters

    MsgBox "ADCInsertUnitsDefaultSource 参数被设置为: " & ACADPref.ADCInsertUnitsDefaultSource

    ' 重设回参数为原始值
    ACADPref.ADCInsertUnitsDefaultSource = originalValue
    MsgBox "ADCInsertUnitsDefaultSource 参数被重设回: " & originalValue
End Sub