概要 - AutoCAD の基本設定を設定する(ActiveX)

オプションに関係するオブジェクトは 9 つあり、それぞれが [オプション]ダイアログ ボックスのタブと対応しています。

これらのオブジェクトで、レジストリに保存されている[オプション]ダイアログ ボックス内のすべてのオプションにアクセスすることができます。これらのオブジェクトにあるプロパティを使用して、AutoCAD のさまざまな設定をカスタマイズできます。オブジェクトは、次のとおりです。

注: PreferencesProfiles オブジェクトは AutoCAD LT の ActiveX 実装の一部として存在しますが、AutoCAD LT ではプロファイルがサポートされていないため、そのメソッドとプロパティはすべて削除されています。

これらのオブジェクトには、Preferences オブジェクトを使用してアクセスできます。Preferences オブジェクトにアクセスするには、次のように、Application オブジェクトの Preferences プロパティを使用します。

AutoLISP
(setq acadObj (vlax-get-acad-object)
      acadPref (vla-get-Preferences acadObj))
VBA (AutoCAD のみ)
Dim acadPref as AcadPreferences
Set acadPref = ThisDrawing.Application.Preferences

この後、DisplayDraftingFilesOpenSaveOutputProfileSelectionSystemUser プロパティを使用して、それぞれの Preferences オブジェクトにアクセスできます。

クロスヘア カーソルをフル スクリーンに設定する

AutoLISP
(vl-load-com)
(defun c:Ch2_PrefsSetCursor ()
    ;; This example sets the crosshairs of the AutoCAD drawing cursor
    ;; to full screen.

    ;; Access the Preferences object
    (setq acadObj (vlax-get-acad-object)
          acadPref (vla-get-Preferences acadObj))

    ;; Use the CursorSize property to set the size of the crosshairs
    (vla-put-CursorSize (vla-get-Display acadPref) 100)
)
VBA (AutoCAD のみ)
Sub Ch2_PrefsSetCursor()
  ' This example sets the crosshairs of the AutoCAD drawing cursor
  ' to full screen.

  ' Access the Preferences object
  Dim acadPref As AcadPreferences
  Set acadPref = ThisDrawing.Application.Preferences

  ' Use the CursorSize property to set the size of the crosshairs
  acadPref.Display.CursorSize = 100
End Sub

スクロール バーを表示する

AutoLISP
(vl-load-com)
(defun c:Ch2_PrefsSetDisplay ()
    ;; This example disables the scroll
    ;; bars with the DisplayScrollBars
    ;; property.

    ;; Access the Preferences object
    (setq acadObj (vlax-get-acad-object)
          acadPref (vla-get-Preferences acadObj))

    ;; Display the and disable scroll bars
    (vla-put-DisplayScrollBars (vla-get-Display acadPref) :vlax-false)
)
VBA (AutoCAD のみ)
Sub Ch2_PrefsSetDisplay()
  ' This example disables the scroll
  ' bars with the DisplayScrollBars
  ' property.

  ' Access the Preferences object
  Dim acadPref As AcadPreferences
  Set acadPref = ThisDrawing.Application.Preferences

  ' Display the and disable scroll bars
  acadPref.Display.DisplayScrollBars = False
End Sub