Author Topic: Display info at the Cursor  (Read 6623 times)

0 Members and 1 Guest are viewing this topic.

psuchewinner

  • Guest
Display info at the Cursor
« on: October 09, 2008, 03:08:00 PM »
I just had an idea but I am not sure if it would even be possible.  Is there a way to display info, such as xdata or sttribute datta, at the cursor?  I am responsible for a composite drawing that is annotated with leaders and bubbles and I was thinking that it would be cool to display the info at the cursor instead of with leaders and bubbles.  Any ideas?

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Display info at the Cursor
« Reply #1 on: October 09, 2008, 03:11:13 PM »
grread & grtext
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

psuchewinner

  • Guest
Re: Display info at the Cursor
« Reply #2 on: October 10, 2008, 07:07:57 AM »
Couldn't be that simple.......could it?

Alan Cullen

  • Guest
Re: Display info at the Cursor
« Reply #3 on: October 10, 2008, 07:45:23 AM »
Sorry TW...couldn't find those as acad anything.......

As for psuchewinner......

acad can show coord position at the cursor.....and can allow for commands to be entered at the cursor....as for issues like properties as a sweep is done over an entity...I really don't know. I believe I have seen it done....but I don't know how to get back there...sorry

BrunoToniutti

  • Guest
Re: Display info at the Cursor
« Reply #4 on: October 10, 2008, 09:00:09 AM »
it's not exactly what you're asking for, but it could be useful.
To display information, often I use (acet-ui-status txt) from Express Tools. This a no modal little windows that can be use to display information while the cursor is moving on screen.

It's easy to increase his properties (font, number of lines, etc.) with Resource Hacker.

As said Tom Willey, use grread and nentselp to get information about an entity, then display your results with (acet-ui-status txt)
To cancel this little windows, use (acet-ui-status)

Bruno Toniutti
sorry for my english level

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Display info at the Cursor
« Reply #5 on: October 10, 2008, 10:57:21 AM »
Couldn't be that simple.......could it?
grread will read where the cursor is at, and as Bruno stated, you will need something to select the entity also.  Once you get the information you want from the entity, then you can use grtext to display it.

Well it looks like I might have been wrong about grtext.  It seems that it will only display it in two locations; screen menu area or the status line.  There might be another way, but off hand I don't know how exactly to get the text right next to the cursor.  If I get some time to look into this, I will see what I can find.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

dtkell

  • Bull Frog
  • Posts: 217
Re: Display info at the Cursor
« Reply #6 on: October 10, 2008, 10:58:41 AM »
Not sure if these are like what you are referring to, but there is "Bubble for AutoCad" from http://www.bubblecad.com/en/bubble.htm
and "Periscope" from Manusoft at http://www.manusoft.com/Index.stm as add-ons that give you object information at the cursor as it hovers over the object.
\"What sane person could live in this world and not be crazy?\" -Ursula K. Le Guin

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: Display info at the Cursor
« Reply #7 on: October 10, 2008, 11:58:48 AM »
I just had an idea but I am not sure if it would even be possible.  Is there a way to display info, such as xdata or sttribute datta, at the cursor?  I am responsible for a composite drawing that is annotated with leaders and bubbles and I was thinking that it would be cool to display the info at the cursor instead of with leaders and bubbles.  Any ideas?

I recommend to draw all letters and figures in a vector kind, for use with a command grvecs.
Example look on a picture:

fixo

  • Guest
Re: Display info at the Cursor
« Reply #8 on: October 10, 2008, 12:41:16 PM »
Here is my 2 cents

Code: [Select]
(defun dxf (key alist)
  (cdr (assoc key alist))
  )

(defun C:Demo  (/ code cp data elist loop rad)
  (setq loop T)
  (while loop
    (setq code (grread T 2))
    (if
      (and
(= 5 (car code))
(setq data (nentselp "\nSelect circle:" (cadr code)))
(eq "CIRCLE"
    (cdr (assoc 0 (setq elist (entget (car data)))))))
       (progn
(setq rad (dxf 40 elist))
(setq cp (dxf 10 elist))
(setq loop nil)
))
    )
  (acet-ui-status
    (strcat "Center: "
    (vl-princ-to-string cp)
    "\nRadius: "
    (rtos rad 2 3)
    "\nPress ENTER, then close dialog")
    (strcat (dxf 0 elist) " Properties"))
  (command)
  (princ)
  )

~'J'~

sepperl

  • Guest
Re: Display info at the Cursor
« Reply #9 on: October 10, 2008, 04:05:54 PM »
The attached file contains a LISP, which draws a text as grvecs.

GDF

  • Water Moccasin
  • Posts: 2081
Re: Display info at the Cursor
« Reply #10 on: October 10, 2008, 05:37:58 PM »
The attached file contains a LISP, which draws a text as grvecs.

Very clever

Had to add (c:demo) to your routine and then drag the routine on the screen for it to work for me.
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

BrunoToniutti

  • Guest
Re: Display info at the Cursor
« Reply #11 on: October 11, 2008, 04:45:52 AM »
now i'm at home, so here an old function that display area and/or lenght of entities in real time (I've never tested it with imperial units)

To avoid any problem for me : this function is provided “as-is” without any warranty of any kind

Code: [Select]
;FUNCTION :             display area and/or lenght of entities in real time for metric ISO system
;USE:                   lod
;REALIZATION :          Bruno Toniutti
;PROPERTY :             Bruno Toniutti
;
;LICENCE :              Vous pouvez utilisez cette fonction librement si l'intégralité de son entête est conservée.
;                       Cette fonction est à utiliser tel quel sans garantie implicite ou explicite
;                       quant à son utilisation et en dégageant Bruno Toniutti de toute responsabilité
;                       quels que soient les dommages directs ou indirects occasionnés par son utilisation.
;                       Sa diffusion doit être libre de toute rétribution directe ou indirecte auprès du diffuseur.
;
;RELEASES :             1.020614 first
;                       1.081011 specific for theswamp.org
;
;NOTES :                need Express Tools
;
;---------------------------------------------------------------------------------------------------

(vl-load-com)

(defun FonctionErreur (s)
  (acet-ui-status)
  (if temp1 (redraw temp1 4))
  (if ename (redraw ename 4))
  (setq *error* ErrorSave)
  (mapcar '(lambda (x) (set x nil)) '( ErrorSave areae analysee objectname objectnamelenght objectnamearea txtoutput catch sse temp1 ename elist etype DynInput))
  (setvar "cmdecho" 1)
  (princ)
)

; Main Function
(defun c:lod ( / ErrorSave areae analysee objectname objectnamelenght objectnamearea txtoutput catch sse temp1 ename elist etype DynInput)

  ;Affectation des variables
  (setq ErrorSave *error*)
  (setq *error* FonctionErreur)
  (setvar "cmdecho" 0)
  (setq areae (lambda (x) (vlax-get x 'Area)))
  (setq analysee
    (lambda (x)
      (cond
        ((or (= x "POLYLINE")(= x "LWPOLYLINE")(= x "LINE")(= x "CIRCLE")(= x "ARC")(= x "SPLINE"))
           (progn
            (setq objectname (vlax-ename->vla-object ename))
            (setq objectnamelenght (rtos (vlax-curve-getdistatparam objectname (vlax-curve-getendparam objectname)) 2 2))
            (if (vlax-curve-isClosed objectname)
              (setq objectnamearea (rtos (areae objectname) 2 2))
              (setq objectnamearea "Entité non close")
            )
            (setq txtoutput (strcat "Type : " etype "\nLongueur : " objectnamelenght "\nSurface : " objectnamearea))
          )
        )
        ((= x "HATCH")
           (progn
            (setq objectname (vlax-ename->vla-object ename))
            (setq catch (vl-catch-all-apply 'areae (list objectname)))
            (if (not (vl-catch-all-error-p catch))
              (progn
                (setq objectnamearea (rtos (areae objectname) 2 2))
                (setq txtoutput (strcat "Type : " etype "\nLongueur : sans\nSurface : " objectnamearea))
              )
              (setq txtoutput (strcat "Type : " etype "\nLongueur : sans\nSurface : indéterminable"))
            )
          )
        )
        (T (setq txtoutput (strcat "Type : " etype "\nLongueur : sans\nSurface : sans")))
      )
    )
  )

  ;Initialization
  (acet-ui-status "" "LongueurDyn")
  (while (not (setq sse (ssget (cadr (grread T 5 2))))))
  (setq temp1 (ssname sse 0))
  (redraw temp1 3)
  (setq ename temp1)
  (setq elist  (entget temp1))
  (setq etype (cdr (assoc 0 elist)))
  (analysee etype)
  (acet-ui-status txtoutput)

  ;Main
  (while (setq DynInput (grread T 5 2))
    (if (ssget (cadr DynInput))
      (progn
        (setq ename (ssname (ssget (cadr DynInput)) 0))
        (if (not (equal ename temp1))
          (progn
            (redraw temp1 4)
            (redraw ename 3)
            (setq temp1 ename)
            (setq elist  (entget ename))
            (setq etype (cdr (assoc 0 elist )))
            (analysee etype)
            (acet-ui-status txtoutput)
          )
        )
      )
    )
  )

  ;Exit
  (acet-ui-status)
  (if temp1 (redraw temp1 4))
  (if ename (redraw ename 4))
  (setq *error* ErrorSave)
  (setvar "cmdecho" 1)
  (princ)
)

Bruno Toniutti
« Last Edit: October 14, 2008, 06:30:20 AM by Bruno Toniutti »

VovKa

  • Water Moccasin
  • Posts: 1632
  • Ukraine
Re: Display info at the Cursor
« Reply #12 on: October 11, 2008, 11:46:29 AM »
my sample code is almost the same as sepperl's, but without grvecs, may be useful for those using non latin char sets
2005 and above
Code: [Select]
(defun C:test (/ Input EntName TextEntName ViewSize *error*)
  (defun *error* (msg) (and TextEntName (entdel TextEntName)))
  (while (and (setq Input (grread T 4 2)) (= (car Input) 5))
    (if TextEntName
      (progn (entdel TextEntName) (setq TextEntName nil))
    )
    (if (and (setq EntName (car (nentselp (cadr Input))))
     (not (eq TextEntName EntName))
)
      (progn (setq ViewSize (getvar "VIEWSIZE"))
     (setq TextEntName
    (entmakex
      (list
(cons 0 "MTEXT")
(cons 100 "AcDbEntity")
(cons 100 "AcDbMText")
(cons 1
      (strcat "Type:  "
      (cdr (assoc 0 (entget EntName)))
      "\nLayer: "
      (cdr (assoc 8 (entget EntName)))
      )
)
(cons 10
      (polar (cadr Input) 0 (/ ViewSize 50.0))
)
(cons 40 (/ ViewSize 50.0))
(cons 50 0.0)
(cons 62 250)
(cons 71 1)
(cons 72 5)
(cons 90 1)
(cons 63 255)
(cons 45 1.2)
      )
    )
     )
      )
    )
  )
  (and TextEntName (entdel TextEntName))
  (princ)
)

BrunoToniutti

  • Guest
Re: Display info at the Cursor
« Reply #13 on: October 13, 2008, 09:04:04 AM »
nice,
I tested your solutions, Sepperl and VovKa, they works great  :-) I'll update some routines

Bruno

psuchewinner

  • Guest
Re: Display info at the Cursor
« Reply #14 on: October 13, 2008, 12:43:02 PM »
Very Cool.  That is the sort of thing i was looking for!