Author Topic: grread (mouse click event)  (Read 2248 times)

0 Members and 1 Guest are viewing this topic.

ChrisCarlson

  • Guest
grread (mouse click event)
« on: August 03, 2015, 09:52:21 AM »
Code - Auto/Visual Lisp: [Select]
  1.                         (while (equal run 1)
  2.                                 (cond
  3.                                         ((equal (grread nil 14 0) '(2 9))
  4.                                                 (cond
  5.                                                         ((equal textdel 1)
  6.                                                                 (prompt "\nText Deletion Disabled \nSelect Cell to edit: ")
  7.                                                                 (setq textdel 0))
  8.                                                         ((equal textdel 0)
  9.                                                                 (prompt "\nText Deletion Enabled \nSelect Cell to edit: ")
  10.                                                                 (setq textdel 1))))
  11.                                         ((equal (car (grread t 4 0)) 5)
  12.                                                 (setq run 0)                                   
  13.                         (if (/= (setq pt (vlax-3d-point (cadr (grread t 4 0)))) nil)
  14.  
  15.  

So I have a prompt which allows either [TAB] to be pressed or a valid mouse click. My issue is that currently the routine will not advance until the mouse is moved. Is there a better way to process the grread
Code - Auto/Visual Lisp: [Select]
  1. ((equal (car (grread t 4 0)) 5)
and also check that it is a valid 3d-point?

ribarm

  • Gator
  • Posts: 3297
  • Marko Ribar, architect
Re: grread (mouse click event)
« Reply #1 on: August 03, 2015, 10:35:09 AM »
What input do you want to make for routine to continue to work if it's not mouse movement? Then specify that option at the end of cond statement instead of (= (car (grread t)) 5)
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

ChrisCarlson

  • Guest
Re: grread (mouse click event)
« Reply #2 on: August 03, 2015, 10:40:43 AM »
Looking for on-click, the method I have now works only if the click is followed up by a mouse movement.

ChrisCarlson

  • Guest
Re: grread (mouse click event)
« Reply #3 on: August 03, 2015, 01:38:58 PM »
Thanks to, http://www.cadtutor.net/forum/showthread.php?57304-Get-quot-alert-quot-when-pressing-a-key-in-a-while-loop-how&p=388898&viewfull=1#post388898

This seems to work

Code - Auto/Visual Lisp: [Select]
  1.                         (setq   gr (grread t 15 0)
  2.                                         code (car gr)
  3.                                         data (cadr gr)
  4.                         )
  5.                                 (cond
  6.                                         ((and (equal 2 code) (equal 9 data))
  7.                                                 (cond
  8.                                                         ((equal textdel 1)
  9.                                                                 (prompt "\nText Deletion Disabled \n[TAB] to enable text delete \nSelect Cell to edit: ")
  10.                                                                 (setq textdel 0)
  11.                                                         )
  12.                                                         ((equal textdel 0)
  13.                                                                 (prompt "\nText Deletion Enabled \n[TAB] to disable text delete \nSelect Cell to edit: ")
  14.                                                                 (setq textdel 1)
  15.                                                         )
  16.                                                 )
  17.                                         )
  18.                                         ((equal 3 code)
  19.                                                 (setq run 0)                                   
  20.                                                 (if (/= (setq pick (vlax-3d-point data)) nil)
« Last Edit: August 07, 2015, 01:46:27 PM by ChrisCarlson »