TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Peter2 on March 03, 2016, 04:59:09 AM

Title: Using grread with osnap
Post by: Peter2 on March 03, 2016, 04:59:09 AM
(Question has a low priority)

Maybe a simple question and a simple idea:

I use grread to display the coordinates of the cursor - 2 lines of code

But I want that an "osnap" is active while moving the mouse. Usually, osnap is only active when a command is active (drawing, ID ...). the idea is for example to move the cursor to a line - "osnap end" is active - grread shows me the coords of the endpoints, not of the cursor. Similar to the standard "ID" command, but "dynamically moving".

Any simple solutions?
Title: Re: Using grread with osnap
Post by: ribarm on March 03, 2016, 05:15:18 AM
http://www.lee-mac.com/grsnap.html
Title: Re: Using grread with osnap
Post by: Stefan on March 03, 2016, 05:17:47 AM
Maybe this, but no osnap glyph.

Code - Auto/Visual Lisp: [Select]
  1.   (= (car (setq grp (grread T 5 0))) 5)
  2.   (setq cursor_position (cadr grp))
  3.   (setq ID_point
  4.          (cond
  5.            ((osnap cursor_position "_end")) ;"_end,_mid,_int"
  6.            (cursor_position)
  7.            )
  8.         )
  9.   (princ (strcat "\rCurrent point: " (vl-princ-to-string ID_point)))
  10.   )
Title: Re: Using grread with osnap
Post by: Peter2 on March 03, 2016, 05:28:48 AM
http://www.lee-mac.com/grsnap.html
Everytime when I look at Lees code I understand the difference between singing in the soccer stadium and Pavarotti.

Maybe this, but no osnap glyph.
Thanks - fine working and compact.
Title: Re: Using grread with osnap
Post by: cmwade77 on March 03, 2016, 05:25:24 PM
Everytime when I look at Lees code I understand the difference between singing in the soccer stadium and Pavarotti.

No kidding, I agree completely, it's probably why so much of his code is scattered throughout our routines.