Vica Posted Thursday at 10:56 PM Posted Thursday at 10:56 PM Hi again, I'm trying to figure out a way for changing text to be displayed in real time next to the cursor during the execution of a Lisp code, when it gets close to objects with relevant information. Is there a simple way to achieve this? Thanks in advance. Quote
BIGAL Posted Thursday at 11:57 PM Posted Thursday at 11:57 PM (edited) I guess using GRREAD to pick a point in real time and behind the scenes do a search box looking for text and in particular a match say "ABC" in "ABCDEFGH" if yes then zoom in on that text. I am not good at GRREAD code so some one else may be able to help. Search box.part based on a pick point. (setq off 18) ; needs to be changed to suit a dwg. (while (setq pt (getpoint "\nPick point ")) (setq pt1 (polar pt (* 0.25 pi) off)) (setq pt2 (polar pt (* 0.75 pi) off)) (setq pt3(polar pt (* 1.25 pi) off)) (setq pt4 (polar pt (* 1.75 pi) off)) (setq pts (list pt1 pt2 pt3 pt4 pt1)) (setq ss (ssget "CP" pts '((0 . "TEXT")))) (if (= ss nil) (princ "\n nothing found ") (princ (strcat "\n" (cdr (assoc 1 (entget (ssname ss 0)))) " found")) ) ) Edited yesterday at 12:20 AM by BIGAL 2 1 Quote
mhupp Posted yesterday at 01:02 AM Posted yesterday at 01:02 AM (edited) This might be a starting point https://www.lee-mac.com/grtext.html combine BIGAL and demo one? Edited yesterday at 01:03 AM by mhupp 2 Quote
Danielm103 Posted yesterday at 02:38 AM Posted yesterday at 02:38 AM (edited) Not lisp, One approach would be to use a point monitor https://www.cadtutor.net/forum/topic/98349-use-a-point-monitor-to-add-items-to-the-hover-tooltip/ A draw jig might be also work depending on the context. Edited yesterday at 02:39 AM by Danielm103 2 Quote
Vica Posted 3 hours ago Author Posted 3 hours ago Thank you all for your replies. Bigal, I don’t really understand how to use that. Mhupp, I discovered LeeMac’s GRText a few weeks ago, but it’s too long and I haven’t been able to figure out how it works. Daniel, it’s very interesting and quite similar to what I’m looking for, but I’d prefer it to be in Lisp since it’s the only language I understand a bit. Could it be implemented as a DLL to be called from Lisp? That way, it might be more versatile across both recent and older versions of AutoCAD, right? I have a routine that inserts text labels indicating the insertion point on the screen. But I’d like to see a distance indicator relative to the previous label inserted. I’ll also try to make it so that, when the cursor hovers over an object on certain layers, it shows the value of any interesting property at the cursor Quote
Vica Posted 3 hours ago Author Posted 3 hours ago Although I suppose the reference for this is Lee Mac's GRText because it's not easy to achieve something simpler. So I'll keep trying to assimilate Lee Mac's code. Anyway, it would be great news for me if anyone can suggest something simpler. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.