Author Topic: New Qusetion: Vlr-Mouse-Reactor  (Read 2778 times)

0 Members and 1 Guest are viewing this topic.

Dream.Fei

  • Guest
New Qusetion: Vlr-Mouse-Reactor
« on: May 03, 2007, 09:06:48 AM »
Test of Mouse doubleclick.
how can I stop the "_.properties" after the dialog done?
(LispFile and odc in the Zip)
Code: [Select]
;;; _______load and show dialog_________
(defun odcl_show (project dialog)
  (if (not (member "OpenDCL17.arx" (arx)))
    (arxload "OpenDCL17.arx" "File OpenDCL17.arx was not find.")
  )
  (odcl_loadproject project t)
  (odcl_form_show project dialog)
)
;;; ____________________________________
(defun c:mouse-reactor-dialog_form1_oninitialize (/)
  (if $test-text
    (odcl_control_settext mouse-reactor-dialog_form1_textbox1 $test-text)
    (odcl_control_settext mouse-reactor-dialog_form1_textbox1
  "Test For Mouse-Reactor"
    )
  )
  (if $click-from-reactor
    (odcl_control_settext mouse-reactor-dialog_form1_textbox1 $reactor-text)
  )
)
(defun c:mouse-reactor-dialog_form1_textbutton1_onclicked (/)
  (setq $test-text (odcl_control_gettext mouse-reactor-dialog_form1_textbox1))
  (odcl_form_close mouse-reactor-dialog_form1)
  (setq $test-return 1)
)
(defun c:mouse-reactor-dialog_form1_textbutton2_onclicked (/)
  (odcl_form_close mouse-reactor-dialog_form1)
  (setq $test-return 0)
)
;;; ______________mouse reactor____________________
(if (null $test-mouse-reactor-function)
  (setq $test-mouse-reactor-function (vlr-mouse-reactor "" '(
(:vlr-begindoubleclick . *test-mouse-reactor-callback*)
)
     )
  )
)
(defun *test-mouse-reactor-callback* (reactor point)
  (setq $last-point (car point)
$lastclick_ename (car (nentselp $last-point))
  )
  (if (and
$lastclick_ename
(setq handle (vlax-ldata-get $lastclick_ename "handle"))
      )
    (progn
      (setvar "DBLCLKEDIT" 0)        ; _this is the problem
      (setq obj (cadr handle)
    $reactor-text (vla-get-textstring obj)
    $click-from-reactor 1
      )
      (odcl_show "Mouse-Reactor-Dialog" "Form1")
      (if (= $test-return 1)
(vla-put-textstring obj $test-text)
      )
      (setq $click-from-reactor nil)
      (setvar "DBLCLKEDIT" 1)        ; _this is the problem
    )
  )
)
;;; _______________main lisp________________
(defun c:test (/ *modelspace* p1 p2 vla-line vla-text vla-lst en g-name ss)
  (odcl_show "Mouse-Reactor-Dialog" "Form1")
  (setq *modelspace* (vla-get-modelspace (vla-get-activedocument
(vlax-get-acad-object)
)
     )
  )
  (if (= $test-return 1)
    (if (setq p1 (getpoint "\nInsert Point:"))
      (if (setq p2 (getpoint p1 "\nEnd Point:"))
(progn
  (setq vla-line (vla-addline *modelspace* (vlax-3d-point p1)
      (vlax-3d-point p2)
)
vla-text (vla-addtext *modelspace* $test-text
      (vlax-3d-point p2) (getvar "dimscale")
)
vla-lst (list vla-line vla-text)
ss (ssadd)
g-name (rtos (* 1e8 (getvar "cdate")))
  )
  (foreach obj vla-lst
    (setq en (vlax-vla-object->ename obj)
  ss (ssadd en ss)
    )
    (vlax-ldata-put en "Handle" vla-lst)
  )
  (command "group" "c" g-name "" ss "")
)
      )
    )
  )
  (princ)
)
(princ "\nMouse-Reactor test , Enter \"Test\" to run.")
« Last Edit: May 03, 2007, 09:15:42 AM by Dream.Fei »

Patrick_35

  • Guest
Re: New Qusetion: Vlr-Mouse-Reactor
« Reply #1 on: May 04, 2007, 07:10:43 AM »
Hello
You can't or i don't find how to do that  :?

@+

Dream.Fei

  • Guest
Re: New Qusetion: Vlr-Mouse-Reactor
« Reply #2 on: May 04, 2007, 07:56:34 AM »
Someone in my QQ Group can do that .
He use "unload Arx" when DoubleClick and after the dialog done load the arx.
I don't know why on my Computer can't.

SOS!
« Last Edit: May 04, 2007, 10:23:53 AM by Dream.Fei »

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: New Qusetion: Vlr-Mouse-Reactor
« Reply #3 on: May 04, 2007, 12:55:45 PM »
unload "acdblclkedit.arx".  Then you can completely control double click editing.  I've been doing this since 2002 . . ..
James Buzbee
Windows 8

Dream.Fei

  • Guest
Re: New Qusetion: Vlr-Mouse-Reactor
« Reply #4 on: May 04, 2007, 10:28:28 PM »
I've done this, but on my computer , It can't Stop "_.properties" after dialog done.
This is the code:
Code: [Select]
(defun *test-mouse-reactor-callback* (reactor point)
  (setq $last-point (car point)
$lastclick_ename (car (nentselp $last-point))
  )
  (if (and
$lastclick_ename
(setq handle (vlax-ldata-get $lastclick_ename "handle"))
      )
    (progn
      (vl-catch-all-apply 'arxunload '("AcDblClkEdit.arx"))        ; _this is the problem
      .............
      (vl-catch-all-apply 'arxload '("AcDblClkEdit.arx"))        ; _this is the problem
    )
  )
)
If can't write it in the Mouse-reactor's callback. where I should? Can you modify this test code so I'll know what's wrong with me?
« Last Edit: May 04, 2007, 11:10:22 PM by Dream.Fei »

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: New Qusetion: Vlr-Mouse-Reactor
« Reply #5 on: May 07, 2007, 09:22:57 AM »
I unload it when my custom menu loads at startup: in the *.mnl file.  Another way would be an acad.lsp file located somewhere in autoCad's search path.

jb
James Buzbee
Windows 8