Author Topic: show poly area dynamically  (Read 5000 times)

0 Members and 2 Guests are viewing this topic.

xdcad

  • Bull Frog
  • Posts: 492
Re: show poly area dynamically
« Reply #15 on: November 24, 2023, 11:46:23 PM »
Implemented using point monitor:

Code - Auto/Visual Lisp: [Select]
  1. ;|
  2. Dynamic mouse displays entity information
  3. Switch command, on and off alternately
  4. Command name: XDTB_EntityInfo
  5.  
  6. Switch (on,off) command, odd number on, even number off
  7. |;
  8. (defun c:XDTB_EntityInfo (/ ent lst1 lst2 #area #length)
  9.   (defun Entity_Info (dynpt /)
  10.     (setq ent (nentselp dynpt)
  11.           ent (if (and
  12.                     ent
  13.                     (= (type (last (last ent))) 'ename)
  14.                   )
  15.                 (last (last ent))
  16.                 (car ent)
  17.               )
  18.     )
  19.     (if (and ent
  20.              (xdrx-getpropertyvalue ent "area" "length")
  21.         )
  22.       (progn
  23.         (setq str
  24.                (xdrx-string-format
  25.                  "\nObject   Area:%.2f\n\nObject Length:%.2f\n\n--------------------"
  26.                  #area
  27.                  #length
  28.                )
  29.         )
  30.         str
  31.       )
  32.     )
  33.   )
  34.   (if *Entiy_Info*
  35.     (progn
  36.       (xdrx_PointMonitor)
  37.       (princ "\nEntity data browsing is closed!")
  38.       (setq *Entiy_Info* nil)
  39.     )
  40.     (progn
  41.       (xdrx_PointMonitor "Entity_Info")
  42.       (princ "\nEntity data browsing is open!")
  43.       (setq *Entiy_Info* t)
  44.     )
  45.   )
  46.   (princ)
  47. )
The code I wrote uses XDRX-API,which can be downloaded from github.com and is updated at any time.
===================================
https://github.com/xdcad
https://sourceforge.net/projects/xdrx-api-zip/
http://bbs.xdcad.net