ModelCrosshairColor プロパティ(ActiveX)

モデル空間のクロスヘアと文字の色を指定します。

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

構文と要素

VBA:

object.ModelCrosshairColor
object

タイプ: PreferencesDisplay

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

プロパティの値

読み込み専用: いいえ

タイプ: OLE_COLOR (定数)

注意

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

ペーパー空間のレイアウトのクロスヘア カーソルの色を指定するには、LayoutCrosshairColor プロパティを使用します。

VBA:

Sub Example_ModelCrossHairColor()
    ' This example returns the current setting of
    ' Model space CrossHairColor. It then changes the value, and
    ' finally resets the value back to the original setting.
    
    Dim preferences As AcadPreferences
    Dim currCrossHairColor As OLE_COLOR
    
    Set preferences = ThisDrawing.Application.preferences
    
    ' Retrieve the current CrossHairColor value
    currCrossHairColor = preferences.DISPLAY.ModelCrosshairColor
    MsgBox "The current value for the model space CrossHairColor is " & preferences.DISPLAY.ModelCrosshairColor, vbInformation, "CrossHairColor Example"
    
    ' Change the value for CrossHairColor
    preferences.DISPLAY.ModelCrosshairColor = vbGreen
    MsgBox "The new value for CrossHairColor is " & preferences.DISPLAY.ModelCrosshairColor, vbInformation, "CrossHairColor Example"
    
    ' Reset CrossHairColor to its original value
    preferences.DISPLAY.ModelCrosshairColor = currCrossHairColor
    MsgBox "The CrossHairColor value is reset to " & preferences.DISPLAY.ModelCrosshairColor, vbInformation, "CrossHairColor Example"
        
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_ModelCrossHairColor()
    ;; This example returns the current setting of
    ;; Model space CrossHairColor. It then changes the value, and
    ;; finally resets the value back to the original setting.
    (setq acadObj (vlax-get-acad-object))
    (setq preferences (vla-get-Preferences acadObj))
  
    ;; Get the Display preferences object
    (setq ACADPref (vla-get-Display preferences))
    
    ;; Retrieve the current CrossHairColor value
    (setq currCrossHairColor (vlax-variant-change-type (vla-get-ModelCrosshairColor ACADPref) vlax-vbLong))
    (alert (strcat "The current value for the model space CrossHairColor is " (itoa (vlax-variant-value currCrossHairColor))))
    
    ;; Change the value for CrossHairColor
    (vla-put-ModelCrosshairColor ACADPref (vlax-make-variant acGreen 19))
    (setq newValue (vlax-variant-change-type (vla-get-ModelCrosshairColor ACADPref) vlax-vbLong))
    (alert (strcat "The new value for CrossHairColor is " (itoa (vlax-variant-value newValue))))
    
    ;; Reset CrossHairColor to its original value
    (vla-put-ModelCrosshairColor ACADPref (vlax-variant-change-type currCrossHairColor 19)) 
    (alert (strcat "The CrossHairColor value is reset to " (itoa (vlax-variant-value currCrossHairColor))))
)