明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 872|回复: 3

[已解答] 画PL线时双击进行撤销(U)

[复制链接]
发表于 2015-8-14 11:06:03 | 显示全部楼层 |阅读模式
画PL线时双击进行撤销(U),U输入到命令那儿不会执行,要怎么处理?谢谢

(vl-load-reactors)
(if (not mouse_reactor)
  (setq        mouse_reactor
         (vlr-mouse-reactor
           nil
           '((:vlr-beginDoubleClick . testtt))
         )
  )
)

(defun testtt (a b)
  (print "U")
)


"觉得好,就打赏"
还没有人打赏,支持一下
发表于 2015-8-14 12:23:55 | 显示全部楼层
双击也会画一根线,所以应该回退两步,

  1. (defun testtt (a b)
  2.   ;(Vlax-Invoke-Method (Vlax-Get-Or-Create-Object "WScript.Shell" ) 'Sendkeys "u ");回退一步,
  3.   (Vlax-Invoke-Method (Vlax-Get-Or-Create-Object "WScript.Shell" ) 'Sendkeys "u u ");回退两步,
  4. )
发表于 2015-8-14 12:32:34 | 显示全部楼层
  1. (vl-load-reactors)
  2. (if (not mouse_reactor)
  3.   (progn
  4.   (setq        mouse_reactor
  5.          (vlr-mouse-reactor
  6.            nil
  7.            '((:vlr-beginDoubleClick . testtt))
  8.          )
  9.   )
  10.   (vlr-remove mouse_reactor)
  11.   )
  12. )
  13. (if (not pl_reactor)
  14.   (setq        pl_reactor
  15.          (vlr-command-reactor
  16.            nil
  17.            '((:vlr-commandWillStart . pl_testtt)
  18.              (:vlr-commandEnded . pl_end)
  19.              (:vlr-commandCancelled . pl_end)
  20.              (:vlr-commandFailed . pl_end)
  21.              )
  22.          )
  23.   )
  24. )
  25. (defun pl_testtt(a b)
  26.   (if(and(= (car b) "PLINE")(not(vlr-added-p mouse_reactor))) (vlr-add mouse_reactor))
  27.   )
  28. (defun pl_end(a b)
  29.   (vlr-remove mouse_reactor)

  30.   )
  31. (defun testtt (a b)
  32.   ;(Vlax-Invoke-Method (Vlax-Get-Or-Create-Object "WScript.Shell" ) 'Sendkeys "u ")
  33.   (Vlax-Invoke-Method (Vlax-Get-Or-Create-Object "WScript.Shell" ) 'Sendkeys "u u ")
  34. )
 楼主| 发表于 2015-8-14 21:58:27 | 显示全部楼层
非常感谢edata
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2025-5-21 11:50 , Processed in 0.186350 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表