ユーザから実数(倍精度浮動小数点数型)値を取得します。
サポートされているプラットフォーム: Windows のみ
VBA:
RetVal = object.GetReal([Prompt])
タイプ: Utility
このメソッドが適用されるオブジェクト。
アクセス: 入力のみ; オプション
タイプ: バリアント型(文字列)
ユーザに入力を求めるときに表示される文字列。
タイプ: 倍精度浮動小数点数型
ユーザから返される値。
AutoCAD は、ユーザが実数値を入力するのを待って、入力された値に対する戻り値を設定します。パラメータ Prompt は、ユーザ入力を求める際に AutoCAD が表示する文字列を指定します。Prompt は、オプションです。
実数値ではなくキーワードが返された場合は、「ユーザ入力がキーワードです」というエラー メッセージが表示されます。GetInput メソッドを使用して、戻り値からキーワードを取得します。
VBA:
Sub Example_GetReal()
' This example returns the Real entered by the user.
AppActivate ThisDrawing.Application.Caption
Dim returnReal As Double
' Return the value entered by user. A prompt is provided.
returnReal = ThisDrawing.Utility.GetReal("Enter an Real: ")
MsgBox "The real entered was " & returnReal & vbCrLf & _
"(Enter the next value without prompting.)", , "GetReal Example"
' Return the value entered by user. No prompt is provided.
returnReal = ThisDrawing.Utility.GetReal()
MsgBox "The real entered was " & returnReal, , "GetReal Example"
End Sub
Visual LISP:
(vl-load-com)
(defun c:Example_GetReal()
;; This example returns the Real entered by the user.
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
;; Return the value entered by user. A prompt is provided.
(setq returnReal (vla-GetReal (vla-get-Utility doc) "Enter an Real: "))
(alert (strcat "The real entered was " (rtos returnReal 2) "\n"
"(Enter the next value without prompting.)"))
;; Return the value entered by user. No prompt is provided.
(setq returnReal (vla-GetReal (vla-get-Utility doc)))
(alert (strcat "The real entered was " (rtos returnReal 2)))
)