Jump to content

Recommended Posts

Posted

 

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.

Posted (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 by BIGAL
  • Like 2
  • Agree 1
Posted

 

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

Posted

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...