从用户获取实数(双精度)值。 支持的平台:仅窗口 签名工 务 局: RetVal = object.GetReal([Prompt])
返回值(RetVal)类型:双 从用户返回的值。 言论AutoCAD 会暂停用户输入实际值,并将返回值设置为用户输入的值。提示参数指定 AutoCAD 在暂停之前显示的字符串。提示是可选的。 如果返回关键字而不是双精度,AutoCAD 将生成错误消息“用户输入关键字”。使用该方法从返回值中获取关键字。GetInput 例子工 务 局: 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))) ) |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:41
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.