GetReal 方法 (ActiveX)
从用户获取实际(双精度)值。 支持的平台:仅限 Windows 签名VBA: RetVal = object.GetReal([Prompt])
返回值 (RetVal)类型:双 从用户返回的值。 言论AutoCAD 暂停用户输入的实际值,并将返回值设置为用户输入的值。Prompt 参数指定 AutoCAD 在暂停之前显示的字符串。提示是可选的。 如果返回关键字而不是双精度键,AutoCAD 将生成错误消息“用户输入关键字”。使用该方法从返回值中获取关键字。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 可视化 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-19 06:40
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.