#!lisp
(defun >DoubleClickDefine ()
(vl-load-com)
(or
*MY_Mouse_Reactor*
(setq *MY_Mouse_Reactor* (vlr-mouse-Reactor "MY_Mouse" '((:vlr-beginDoubleClick . >DoubleClickCallback))))
)
(vl-catch-all-apply 'arxunload '("acdblclkedit.arx"))
(vl-catch-all-apply 'arxload '("acdblclkedit.arx"))
(defun >DoubleClickCallback (reactor point / selp point ent)
(setq point (trans (car point) 0 1))
(if (setq selp (nentselp point))
(progn
(if (> (length selp) 2)
(setq ent (last (last selp)))
(setq ent (car selp))
)
(if (vlax-ldata-get ent "DoubleClick")
(progn
(vl-catch-all-apply 'arxunload '("acdblclkedit.arx"))
(sssetfirst nil)
(>DoubleClickExecute ent point)
(vl-catch-all-apply 'arxload '("acdblclkedit.arx"))
)
)
)
)
)
)
(or
*MY_Mouse_Reactor*
(>DoubleClickDefine)
)
(defun >DoubleClickExecute (ent point)
(prompt (strcat (VL-PRINC-TO-STRING ent) " " (VL-PRINC-TO-STRING point) "\n"))
)
(defun >DoubleClickClearAll (/ ss i e)
(setq *MY_Mouse_Reactor* nil)
(setq ss (ssget "x"))
(setq i 0)
(repeat (sslength ss)
(vlax-ldata-delete (ssname ss i) "DoubleClick")
(setq i (1+ i))
)
)
(defun >DoubleClickAttach (ent on)
(if on
(vlax-ldata-put ent "DoubleClick" T)
(vlax-ldata-delete ent "DoubleClick")
)
)