;自定义空白处双击反应器[xall]

(if (< (atof (getvar "ACADVER")) 20.0) ;在AutoCAD 2015以上版本里面，空白处双击鼠标左键无效
    (progn
        (setq mai_panel_double_click nil) ;nil双击出面板 ，T为双击不出面板
        (setq mai_panel_pspace_click T)   ;nil图纸空间双击出面板 ，T为图纸空间双击不出面板
        (or *Mini_Mouse_Reactor*
            (setq *Mini_Mouse_Reactor* (VLR-Mouse-Reactor nil '((:VLR-beginDoubleClick . MiniDoubleClickCallback))))
        );打开反应器

        (defun MiniDoubleClickCallback ( reactorObject point)
           (and Minidblclkedit
               (not mai_panel_double_click)
               (Minidblclkedit point)
           )
        )

        (defun Minidblclkedit (dblclk_point / dblclk_etype p com )
           (setq com "xall"                       ;指定双击命令名
                 p (trans (car dblclk_point) 0 1) ;指定点来选择对象
           )
           (and (= 0 (getvar 'cmdactive)) ;_有活动命令时不起作用
                (not (nentselp p))
                (or (not mai_panel_pspace_click) (= (getvar "tilemode") 1)) ;模型空间
                (setq p (strcat (rtos (car p) 2 3) "," (rtos (cadr p) 2 3) "\n" com "\n"))
                (vla-sendcommand (vlax-get-property (vlax-get-acad-object) 'activedocument) p)
           )
        )
    )
)

