Author Topic: AREACALC.VLX  (Read 5104 times)

0 Members and 1 Guest are viewing this topic.

fred_bock

  • Guest
AREACALC.VLX
« Reply #15 on: February 02, 2005, 06:03:49 AM »
this print area is a good start... but is any way that can change it to m ???
i'm rearching for a way to calculate areas into a xls table .. or even into a cad table.... the only way i found by now is using the ADT tools...

there is a way to write at one cell to get the value of a polyline ??

Scott

  • Bull Frog
  • Posts: 244
AREACALC.VLX
« Reply #16 on: February 02, 2005, 09:20:16 AM »
fred_bock

I have a routine that will extract the areas of polylines to a text file.  I use it to calculate pond volumes.  Let me know if your intested.  It was written by John Kaul.  It is pretty useful to me.

Scott

CADwoman

  • Guest
AREACALC.VLX
« Reply #17 on: April 04, 2005, 12:53:08 PM »
Thanks, how can I edit this so that it displays SqFt when MEASUREMENT=0 and SqMeters when MEASUREMENT=1

Quote from: CADaver
Quote from: danny
CADaver,
I got this error message.  Seems like the code is missing the subroutine (TXSTLA)
AACKK ,sorry again, I missed it when I scanned for it earlier.  that's another subroutine for setting layers and styles for text.  Find the
Code: [Select]
(TXSTLA) and delete that entire line.  Today just isn't my day.
~~~~~~~
Or here's the whole dang thang agin, minus the troublesome bit.

Code: [Select]
(defun CalcAREA ()
  (setq a 0
        ss (ssget '((-4 . "<OR")(0 . "CIRCLE")(0 . "region")(0 . "*polyline")(-4 . "OR>"));;;'((0 . "*POLYLINE"))
            )
   )
  (if ss
    (progn
      (setq n (1- (sslength ss)))
      (while (>= n 0)
        (command "_.area" "_o" (ssname ss n))
        (setq a (+ a (getvar "area"))
              n (1- n))
      ) ;;close while
     );;close progn
    (alert "\nNo Polylines selected!")
) ;;close if
  (princ)
) ;;close defun
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun C:ListAREA ()
(calcarea)
(if (/= a 0)
(progn
     (alert
        (strcat "The total area of the selected object(s) is\n\n     "
        (strcat
             (rtos a 2 2) " Sq In,\nor\n        "
             (rtos (/ a 144.0) 2 2) " Sq Ft, \nor\n             "
             (rtos (cvunit a "sq in" "Acres") 2 3) " Acres")
         ))
)
)
(princ)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun C:TAGAREA ()
(calcarea)
(if (/= a 0)
(progn
(setq str3
        (strcat            
             (rtos (/ a 144.0) 2 2) " Sq Ft\\P"
             (rtos (cvunit a "sq in" "acres") 2 3) " Acres"
         )
)
(setq at2  (getpoint "\nLocation for text... "))
(command "Mtext" at2 "R" "0" "J" "MC" "W" "0" str3 "")
)
)
(princ)
)

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
AREACALC.VLX
« Reply #18 on: April 04, 2005, 01:34:24 PM »
I updated my area print to display meters, perhaps it will work for you.
http://www.theswamp.org/phpBB2/viewtopic.php?p=16451#16451
I've reached the age where the happy hour is a nap. ()
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.