永不言弃 发表于 2015-8-14 11:06:03

画PL线时双击进行撤销(U)

画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")
)


edata 发表于 2015-8-14 12:23:55

双击也会画一根线,所以应该回退两步,

(defun testtt (a b)
;(Vlax-Invoke-Method (Vlax-Get-Or-Create-Object "WScript.Shell" ) 'Sendkeys "u ");回退一步,
(Vlax-Invoke-Method (Vlax-Get-Or-Create-Object "WScript.Shell" ) 'Sendkeys "u u ");回退两步,
)

edata 发表于 2015-8-14 12:32:34

(vl-load-reactors)
(if (not mouse_reactor)
(progn
(setq      mouse_reactor
         (vlr-mouse-reactor
         nil
         '((:vlr-beginDoubleClick . testtt))
         )
)
(vlr-remove mouse_reactor)
)
)
(if (not pl_reactor)
(setq      pl_reactor
         (vlr-command-reactor
         nil
         '((:vlr-commandWillStart . pl_testtt)
             (:vlr-commandEnded . pl_end)
             (:vlr-commandCancelled . pl_end)
             (:vlr-commandFailed . pl_end)
             )
         )
)
)
(defun pl_testtt(a b)
(if(and(= (car b) "PLINE")(not(vlr-added-p mouse_reactor))) (vlr-add mouse_reactor))
)
(defun pl_end(a b)
(vlr-remove mouse_reactor)

)
(defun testtt (a b)
;(Vlax-Invoke-Method (Vlax-Get-Or-Create-Object "WScript.Shell" ) 'Sendkeys "u ")
(Vlax-Invoke-Method (Vlax-Get-Or-Create-Object "WScript.Shell" ) 'Sendkeys "u u ")
)

永不言弃 发表于 2015-8-14 21:58:27

非常感谢edata
页: [1]
查看完整版本: 画PL线时双击进行撤销(U)