Author Topic: Using grread with osnap  (Read 2344 times)

0 Members and 1 Guest are viewing this topic.

Peter2

  • Swamp Rat
  • Posts: 650
Using grread with osnap
« 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?
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

ribarm

  • Gator
  • Posts: 3225
  • Marko Ribar, architect
Re: Using grread with osnap
« Reply #1 on: March 03, 2016, 05:15:18 AM »
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

Stefan

  • Bull Frog
  • Posts: 319
  • The most I miss IRL is the Undo button
Re: Using grread with osnap
« Reply #2 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.   )

Peter2

  • Swamp Rat
  • Posts: 650
Re: Using grread with osnap
« Reply #3 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.
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: Using grread with osnap
« Reply #4 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.