画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")
)
双击也会画一根线,所以应该回退两步,
(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 ");回退两步,
) (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 ")
) 非常感谢edata
页:
[1]