Results 1 to 4 of 4

Thread: need a little help for AREA TEXT lisp

  1. #1
    Woo! Hoo! my 1st post
    Join Date
    2013-10
    Posts
    1
    Login to Give a bone
    0

    Default need a little help for AREA TEXT lisp

    hello Geeks
    i have found one useful lisp file for area (pick poly line and place a text on the dwg)
    here is a lisp file
    Code:
    (defun drtxt (/ rn tx ls vl lt ht lb hb nr pt)
      (setq tx (strcat "Area: " 
           (rtos (/ (getvar "area") 1000000) 2 2) 
           " m2"
           )         
           rn (getstring "\nRoom Name: ")
      )
      (setq ls (list (cons 1 tx))
          vl (textbox ls)
          vl (cadr vl)
          lt (car vl)
          ht (cadr vl)
          vl (grread T)
          nr (car vl)
          pt (cadr vl)
      )
      (princ "\nInsert Point: ")
      (while (/= nr 3)
        (command "redraw")
        (grdraw pt (setq pt (polar pt 0 lt)) 7)
        (grdraw pt (setq pt (polar pt (* pi 0.5) ht)) 7)
        (grdraw pt (setq pt (polar pt pi lt)) 7)
        (grdraw pt (polar pt (* pi 1.5) ht) 7)
        (setq vl (grread T)
          nr (car vl)
          pt (cadr vl)
        )
        ) ;end while function
      (command "-mtext" pt "w" 0 rn tx "")
      (redraw)
    ) ; end drtxt function
    
    (defun c:pla ()
      (setvar "cmdecho" 0)
      (while (setq et 
           (car 
                 (entsel "\nSelect polyline: ")
             ) ;end car function
         ) ;end setq function
      (command "area" "o" et)
      (drtxt)
      ) ; wnd while funtion
    
    (setvar "cmdecho" 1)
    (princ)
    
    ) ; end c:pla function
    what i want to modify is, just a area without typing a Room Name.
    can someone help me edit the original lisp?
    i would be very much appreciated, if someone could help me with this.
    thanks a lot
    YWN
    Attached Files Attached Files
    Last edited by Opie; 2013-10-25 at 03:51 PM. Reason: [code] tags added

  2. #2
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: need a little help for AREA TEXT lisp

    Check this out .

    Code:
    (defun drtxt (/ tx ls vl lt ht lb hb nr pt)
      (setq tx (strcat "Area: "
                       (rtos (/ (getvar "area") 1000000) 2 2)
                       " m2"
               )
      )
      (setq ls (list (cons 1 tx))
            vl (textbox ls)
            vl (cadr vl)
            lt (car vl)
            ht (cadr vl)
            vl (grread T)
            nr (car vl)
            pt (cadr vl)
      )
      (princ "\nInsert Point: ")
      (while (/= nr 3)
        (command "redraw")
        (grdraw pt (setq pt (polar pt 0 lt)) 7)
        (grdraw pt (setq pt (polar pt (* pi 0.5) ht)) 7)
        (grdraw pt (setq pt (polar pt pi lt)) 7)
        (grdraw pt (polar pt (* pi 1.5) ht) 7)
        (setq vl (grread T)
              nr (car vl)
              pt (cadr vl)
        )
      )                                     ;end while function
      (command "-mtext" pt "w" 0 tx "")
      (redraw)
    )                                       ; end drtxt function
    
    (defun c:pla (/ et)
      (setvar "cmdecho" 0)
      (while (setq et
                    (car
                      (entsel "\nSelect polyline: ")
                    )                       ;end car function
             )                              ;end setq function
        (command "area" "o" et)
        (drtxt)
      )                                     ; wnd while funtion
    
      (setvar "cmdecho" 1)
      (princ)
    
    )                                       ; end c:pla function

  3. #3
    I could stop if I wanted to
    Join Date
    2015-12
    Posts
    385
    Login to Give a bone
    0

    Default Re: need a little help for AREA TEXT lisp

    Blackbox helped me on a similar program.
    http://forums.augi.com/showthread.ph...g-of-polylines

  4. #4
    Woo! Hoo! my 1st post
    Join Date
    2018-07
    Posts
    1
    Login to Give a bone
    0

    Default Re: need a little help for AREA TEXT lisp

    Thanks. it is very helpful, it works very well

Similar Threads

  1. Replies: 1
    Last Post: 2014-08-08, 05:20 PM
  2. Help with area lisp
    By seanjames in forum AutoLISP
    Replies: 11
    Last Post: 2013-06-27, 06:42 PM
  3. 2011: Moving Text Causes Civil3D Drawing area to shrink usable area
    By Brian Benton in forum AutoCAD Civil 3D - General
    Replies: 0
    Last Post: 2013-05-17, 03:42 PM
  4. LISP routine for Area Command
    By Mac Demer in forum AutoCAD General
    Replies: 12
    Last Post: 2010-07-14, 06:24 PM
  5. LISP to calculate area of rectangle
    By Rynakor in forum AutoLISP
    Replies: 13
    Last Post: 2006-06-20, 01:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •