乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 63|回复: 5

[编程交流] VLISP ret中的“vbYesNo”Mes框

[复制链接]

55

主题

133

帖子

78

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
280
发表于 2022-7-6 11:11:01 | 显示全部楼层 |阅读模式
亲爱的朋友们:,
我在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”)
回复

使用道具 举报

54

主题

3755

帖子

3583

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
438
发表于 2022-7-6 11:25:00 | 显示全部楼层
08年很好用。你在运行什么版本?
 
总是有acet ui消息或滚动您自己的DCL消息。
回复

使用道具 举报

55

主题

133

帖子

78

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
280
发表于 2022-7-6 11:36:34 | 显示全部楼层
 
尊敬的ajant,
 
我使用的是2007,它很好地显示了这个消息框。但是如果我们按yes或no按钮,返回值将为零。
你在08年的价值是多少。让我知道。
 
你能解释一下“acet ui消息”吗?这是怎么一回事?
回复

使用道具 举报

VVA

1

主题

308

帖子

308

银币

初来乍到

Rank: 1

铜币
8
发表于 2022-7-6 11:49:42 | 显示全部楼层
尝试其他版本
  1. (defun vva-MsgBox (Message Title Flags Timeout / WScript ret)
  2. ;;; Message          -  is the message to display
  3. ;;; Title         -  is the title of the Message Box
  4. ;;; Flags        -  is the bitwise number indicating the MessageBox Options
  5. ;;; Timeout         -  is a number (in seconds) to wait before automatically closing (0 = wait forever)
  6. ;;;Return values
  7. ;;;-1   Timed Out
  8. ;;;0     Error
  9. ;;;1     OK
  10. ;;;2     Cancel
  11. ;;;3     Abort
  12. ;;;4     Retry
  13. ;;;5     Ignore
  14. ;;;6     Yes
  15. ;;;7     No
  16. ;;;10   TryAgain
  17. ;;;11   Continue
  18. ;;;================ Flags ======================================
  19. ;;;Flags is a bitwise number indicating the various options.
  20. ;;;
  21. ;;;Options supported:
  22. ;;;
  23. ;;;Buttons values
  24. ;;;0   OK Only
  25. ;;;1   OK Cancel
  26. ;;;2   Abort Retry Ignore
  27. ;;;3   Yes No Cancel
  28. ;;;4   Yes No
  29. ;;;5   Retry Cancel
  30. ;;;6   Cancel TryAgain Continue
  31. ;;;
  32. ;;;Icon values
  33. ;;;0   No Icon
  34. ;;;16 Stop
  35. ;;;32 Question
  36. ;;;48 Exclamation
  37. ;;;64 Information
  38. ;;;
  39. ;;;
  40. ;;;Set Default Button (which button has focus and will return if user presses {enter} or {spc})
  41. ;;;0      First
  42. ;;;256   Second (defaults to first if no second button)
  43. ;;;512   Third (defaults to first if no third button)
  44. ;;;
  45. ;;;Message Box Modal Status
  46. ;;;0       Application
  47. ;;;4096  System (causes message box to remain topmost)
  48. ;;;
  49. ;;;Message Box Option Flags
  50. ;;;65536    Set MessageBox to Foreground
  51. ;;;131072  Show on Default Desktop only
  52. ;;;262144  Set MessageBox to TopMost
  53. ;;;524288  Right Align Text
  54. ;;;1048576 Right to Left Reading (think Chinese and Arabic)
  55. (setq WScript (vlax-create-object "WScript.Shell"))
  56. (setq ret (vlax-invoke WScript 'Popup Message Timeout Title Flags))
  57. (vlax-release-object WScript)
  58. ret
  59. )
  60. (defun vva-yes-no ( msg title )
  61. ;;; Message          -  is the message to display
  62. ;;; Title         -  is the title of the Message Box
  63. ;;; Return - t - Yes; nil - No
  64. ;;; Use: (vva-yes-no "Are you sure?" "Question" )
  65. (=
  66.   (vva-MsgBox msg title (+
  67.                           4  ;;; Yes No button values
  68.                           32 ;;; Question Icon
  69.                           256 ;;; No buttom defaults
  70.                           )
  71.     0
  72.     )
  73.   6
  74.   )
  75. )
回复

使用道具 举报

55

主题

133

帖子

78

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
280
发表于 2022-7-6 12:03:01 | 显示全部楼层
 
非常感谢你,你太棒了。。
但是我想知道你在这里使用的技术是什么?
Wat是wscript和wscript。壳
实际上它在做什么?
我们如何更有效地使用这种输入输出VLisp?
 
你的
R、 穆图。
回复

使用道具 举报

VVA

1

主题

308

帖子

308

银币

初来乍到

Rank: 1

铜币
8
发表于 2022-7-6 12:17:37 | 显示全部楼层
ActiveX
Windows脚本主机WshShell对象
创建wscript。shell对象
并使用它弹出式方法
我们如何更有效地使用这种输入输出VLisp?
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-6 11:37 , Processed in 0.425769 second(s), 64 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表