Jump to content

Recommended Posts

Posted

Hi again all,

 

I'm just wondering if anyone has a LISP program that works using GrText or any other sort that, when a cursor crosses over an object, displays the layer that object is on next to the cursor.

 

Thanks,

Jonathan Handojo

Posted

FWIW - vanilla LISP

 

3 hours ago, Jonathan Handojo said:

Hi again all,

 

I'm just wondering if anyone has a LISP program that works using GrText or any other sort that, when a cursor crosses over an object, displays the layer that object is on next to the cursor.

 

Thanks,

Jonathan Handojo

 

i've seen Lee has such grtext demo GIF but couldn't find it.

 

how if overlapped, nested objects etc..

my attempt just simple ssget concept, you may need to download LM's GRTEXT

else Layer name displays in command line.

(defun c:foo (/ vs os ap k pt ss en e $ & p)
(defun vs (x) (* (/ (getvar 'viewsize) (cadr (getvar 'screensize))) x))
  (mapcar '(lambda (a b)(set a (getvar b))) '(os ap) '(osmode aperture))
  (setvar 'osmode 0)
  (setq & "\r                    ")
  (terpri)
  (while (and (setq k (grread t 13 0)) (= (car k) 5))
    (redraw)
    (if
      (and (setq p (vs ap) 
		        ss (ssget "_C" (setq pt (cadr k)) (mapcar '+ pt (list (- p) p))))
             (setq en (ssname ss 0) e (entget en))
             (setq $ (cdr(assoc 8 e)))
        )
        
        (if (and LM:GrText LM:DisplayGrText)
            (LM:DisplayGrText pt (LM:GrText $) 3 15 -31 )
            (princ (strcat "\rLayer: " $))
        )

        (princ (setq $ &))
      )
    (princ)
  )
  (redraw)
  (setvar 'osmode os)
  (princ)
)

 

 

 

  • Like 1
Posted (edited)
4 hours ago, steven-g said:

 

BINGO!  Rollovertips has got you covered.   :beer:

 

If you go into your CUI and care to, you can define which of the available General Properties you care to display in the Rollover Tip, check those you want.

If you are too lazy to remember the name of the system variable it is also available in OPTIONS, on the DISPLAY tab.

 

Additionally, the LEE-MAC lisp to which dlanorh supplied the link will, of course since Lee Mac wrote it, do even more!   :beer:

Thanks Lee!  When in doubt, check Lee Mac out!

 

image.thumb.png.f6200aa36e2ae045a8bb9ff5a3f825a2.png

Edited by Dadgad
typo
Posted (edited)

In this case, hanhphuc provided the best solution that I'm after. I'm basically working with thousands of entangled lines and I just need to know where they sit, so that I can use other LISP routines to change them to the layers that I need to. Using a rollover seems to take time and the slightest move of the mouse will make it disappear. It doesn't somehow seem user-friendly if you're a fast worker.

 

Not to say the least, the code provided by dlanorh also works, but is somehow very slow in my computer.

 

ssget is a brilliant idea, didn't cross my mind there. Thanks hanhphuc. With this as a start, I can then organise which layers are prior to display first compared to others (for example, if two objects are overlapping the cursor).

Edited by Jonathan Handojo
Posted
5 hours ago, Jonathan Handojo said:

In this case, hanhphuc provided the best solution that I'm after. I'm basically working with thousands of entangled lines and I just need to know where they sit, so that I can use other LISP routines to change them to the layers that I need to. Using a rollover seems to take time and the slightest move of the mouse will make it disappear. It doesn't somehow seem user-friendly if you're a fast worker.

 

Not to say the least, the code provided by dlanorh also works, but is somehow very slow in my computer.

 

ssget is a brilliant idea, didn't cross my mind there. Thanks hanhphuc. With this as a start, I can then organise which layers are prior to display first compared to others (for example, if two objects are overlapping the cursor).

 

no worries, credits to Lee Mac :)

i recall Lee's GIF demo (it was not Dinfov.5.lsp), IIRC it was showing a "T" while cursor hovers over objects, it inspired ideas.

grtext (transient) is smoother, not sure entmod slow IMO entity holds dxf data/properties, eg: color or background mask etc..

 

another tweak - checker

(by adjusting aperture color/size)

 

 

p/s: nice DinfoV1.5.lsp beaten me decades !

BCAD has TOOLTIPS too, but normally switched OFF

 

 

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...