muthu123 发表于 2022-7-6 11:11:01

VLISP ret中的“vbYesNo”Mes框

亲爱的朋友们:,
我在VLISP中尝试了以下代码。但在这两种情况下都返回零。请如何在我的Lisp例程中使用msg框,这将对我有很大帮助。请提供替代解决方案。
 
 
 
(vl load com)
(setq applic(vlax get acad对象))
(setq a(vla eval applic)(strcat“MsgBox”Do you want to Change Length“,”
“vbYesNo”、“VBA Expresso”)

alanjt 发表于 2022-7-6 11:25:00

08年很好用。你在运行什么版本?
 
总是有acet ui消息或滚动您自己的DCL消息。

muthu123 发表于 2022-7-6 11:36:34

 
尊敬的ajant,
 
我使用的是2007,它很好地显示了这个消息框。但是如果我们按yes或no按钮,返回值将为零。
你在08年的价值是多少。让我知道。
 
你能解释一下“acet ui消息”吗?这是怎么一回事?

VVA 发表于 2022-7-6 11:49:42

尝试其他版本

(defun vva-MsgBox (Message Title Flags Timeout / WScript ret)
;;; Message        -is the message to display
;;; Title         -is the title of the Message Box
;;; Flags        -is the bitwise number indicating the MessageBox Options
;;; Timeout         -is a number (in seconds) to wait before automatically closing (0 = wait forever)
;;;Return values
;;;-1   Timed Out
;;;0   Error
;;;1   OK
;;;2   Cancel
;;;3   Abort
;;;4   Retry
;;;5   Ignore
;;;6   Yes
;;;7   No
;;;10   TryAgain
;;;11   Continue

;;;================ Flags ======================================
;;;Flags is a bitwise number indicating the various options.
;;;
;;;Options supported:
;;;
;;;Buttons values
;;;0   OK Only
;;;1   OK Cancel
;;;2   Abort Retry Ignore
;;;3   Yes No Cancel
;;;4   Yes No
;;;5   Retry Cancel
;;;6   Cancel TryAgain Continue
;;;
;;;Icon values
;;;0   No Icon
;;;16 Stop
;;;32 Question
;;;48 Exclamation
;;;64 Information
;;;
;;;
;;;Set Default Button (which button has focus and will return if user presses {enter} or {spc})
;;;0      First
;;;256   Second (defaults to first if no second button)
;;;512   Third (defaults to first if no third button)
;;;
;;;Message Box Modal Status
;;;0       Application
;;;4096System (causes message box to remain topmost)
;;;
;;;Message Box Option Flags
;;;65536    Set MessageBox to Foreground
;;;131072Show on Default Desktop only
;;;262144Set MessageBox to TopMost
;;;524288Right Align Text
;;;1048576 Right to Left Reading (think Chinese and Arabic)
(setq WScript (vlax-create-object "WScript.Shell"))
(setq ret (vlax-invoke WScript 'Popup Message Timeout Title Flags))
(vlax-release-object WScript)
ret
)

(defun vva-yes-no ( msg title )
;;; Message        -is the message to display
;;; Title         -is the title of the Message Box
;;; Return - t - Yes; nil - No
;;; Use: (vva-yes-no "Are you sure?" "Question" )
(=
(vva-MsgBox msg title (+
                        4;;; Yes No button values
                        32 ;;; Question Icon
                        256 ;;; No buttom defaults
                        )
    0
    )
6
)
)

muthu123 发表于 2022-7-6 12:03:01

 
非常感谢你,你太棒了。。
但是我想知道你在这里使用的技术是什么?
Wat是wscript和wscript。壳
实际上它在做什么?
我们如何更有效地使用这种输入输出VLisp?
 
你的
R、 穆图。

VVA 发表于 2022-7-6 12:17:37

ActiveX
Windows脚本主机WshShell对象
创建wscript。shell对象
并使用它弹出式方法
我们如何更有效地使用这种输入输出VLisp?
页: [1]
查看完整版本: VLISP ret中的“vbYesNo”Mes框