Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Sum of Areas Lisp?

  1. #1
    Member
    Join Date
    2005-07
    Posts
    4
    Login to Give a bone
    0

    Question Sum of Areas Lisp?

    I was wondering if anyone had a lisp routine that would continuously sum up the areas as I click within their boundaries. I have a pretty scattered commercial development, and I just wanted to see if anyone had a quick and easy way to find the total sq footage.....aside from using the boundary command and listing each one individually.

    Any help or ideas would be greatly appreciated.

    Thanks,
    Mark

  2. #2
    The Silent Type Mike.Perry's Avatar
    Join Date
    2000-11
    Posts
    13,656
    Login to Give a bone
    0

    Default Re: Sum of Areas Lisp?

    Hi

    Have a browse of the following thread -

    Quick adding of multiple closed polyline areas

    Have a good one, Mike

  3. #3
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,269
    Login to Give a bone
    0

    Default Re: Sum of Areas Lisp?

    Hi Mark

    Try this one
    Change by suit
    See POLYAREA.LSP above

    Thank you

    Fatty

    Code:
    (defun C:ametr (/ acsp adoc ar osm pt snip)
      (setq osm (getvar "osmode"))         
      (setvar "osmode" 0)
      (vl-load-com)
      (setq	adoc (vla-get-activedocument
    	       (vlax-get-acad-object)
    	     )
    	acsp (vla-get-block
    	       (vla-get-activelayout adoc)
    	     )
      )
      (vla-startundomark adoc)
    
      (while (setq pt (getpoint "\nPick point inside closed area"))
        (command "._-boundary" pt "")
        (setq snip (vlax-ename->vla-object (entlast)))
        (vla-highlight snip :vlax-true)
        (setq ar (vla-get-area snip))
        (vla-addtext acsp (rtos (/ ar 10000.) 2 2);change on your units
          (vlax-3d-point pt)
          (getvar "TEXTSIZE");cnange on your text height
          ) 
        (vla-delete snip)
        (vlax-release-object snip)
        (setq ar_list (cons ar ar_list))
        )
      (setq summ (apply '+ ar_list))
      (setq ps (getpoint "\nPick summ area point "))
      (vla-addtext acsp (strcat "%%uSumm area: "
    			    (rtos (/ summ 10000.) 2 2);change on your units
    			    " cnange on your units")
        (vlax-3d-point ps) (getvar "TEXTSIZE");cnange on your text height
        )
      (setvar "osmode" osm)
      (vla-endundomark adoc)
      (princ)
    )

  4. #4
    Certifiable AUGI Addict robert.1.hall72202's Avatar
    Join Date
    2004-07
    Location
    Detroit Michigan
    Posts
    2,508
    Login to Give a bone
    0

    Default Re: Sum of Areas Lisp?

    What about giving the option to either add or subtract the next area selected?
    Might have a plate with some holes in it....that would be

  5. #5
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,269
    Login to Give a bone
    0

    Default Re: Sum of Areas Lisp?

    Hi
    Hope this what you need
    Thank you

    Fatty

    Code:
    (defun C:plar (/	acsp	 adoc	  clean_area	    i
    	       int_area	ob	 obj	  osm	   plate    plate_area
    	       plate_ent	 prm	  ss	   vexs
    	      )
      (setq osm (getvar "osmode"))
      (setvar "osmode" 0)
      (vl-load-com)
      (setq	adoc (vla-get-activedocument
    	       (vlax-get-acad-object)
    	     )
    	acsp (vla-get-block
    	       (vla-get-activelayout adoc)
    	     )
      )
      (vla-startundomark adoc)
      (if (setq plate_ent (car (entsel "\nSelect pline \n")))
        (progn
          (setq plate (vlax-ename->vla-object plate_ent))
          (setq plate_area (vla-get-area plate))
          (setq vexs (vl-remove-if
    		   (function not)
    		   (mapcar (function (lambda (x)
    				       (if (eq (car x) 10)
    					 (cdr x)
    				       )
    				     )
    			   )
    			   (entget plate_ent)
    		   )
    		 )
          )
          (setq ss (ssget "WP" vexs))
          (setq int_area 0
    	    i 0
          )
          (repeat (sslength ss)
    	(setq obj (vlax-ename->vla-object (ssname ss i))
    	      i	  (1+ i)
    	      prm (vl-catch-all-apply
    		    (function (lambda ()
    				(vlax-curve-getendparam ob)
    			      )
    		    )
    		  )
    	)
    	(if
    	  (not (vl-catch-all-error-p prm))
    	   (progn
    	     (setq int_area (+ int_area (vla-get-area obj)))
    	   )
    	)
          )
    
          (setq clean_area (- plate_area int_area))
          (alert (strcat
    	       "\nTotal area is: "
    	       (rtos clean_area 2 2)		  ;change by own units  
    	     )
          )
          (vla-delete plate)
          (vlax-release-object plate)
        )
        (alert "\nBad choice...Try again\n")
      )
      (setvar "osmode" osm)
      (vla-endundomark adoc)
      (princ)
    )

  6. #6
    I could stop if I wanted to scwegner's Avatar
    Join Date
    2004-12
    Location
    Minneapolis, MN
    Posts
    449
    Login to Give a bone
    0

    Default Re: Sum of Areas Lisp?

    Quote Originally Posted by fixo
    (alert "\nBad choice...Try again\n")
    That's awesome! More commands ought to be that blunt. I think I'll start doing that: "Bad user! That's not a polyline, Dummy! Try again and this time do it right!"

  7. #7
    Member
    Join Date
    2005-07
    Posts
    4
    Login to Give a bone
    0

    Default Re: Sum of Areas Lisp?

    Thanks for the help and direction...I found just what I needed.

    -Mark

  8. #8
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,269
    Login to Give a bone
    0

    Default Re: Sum of Areas Lisp?

    Hi Mark
    Glad to help you

    Fatty

  9. #9
    Certifiable AUGI Addict robert.1.hall72202's Avatar
    Join Date
    2004-07
    Location
    Detroit Michigan
    Posts
    2,508
    Login to Give a bone
    0

    Default Re: Sum of Areas Lisp?

    Quote Originally Posted by fixo
    Hi
    Hope this what you need
    Thank you

    Fatty
    Hmmmmmmmmmm, Ive loaded the second routine posted and it doesn't work?

  10. #10
    All AUGI, all the time bbapties's Avatar
    Join Date
    2003-12
    Location
    Palm Harbor, FL
    Posts
    537
    Login to Give a bone
    0

    Default Re: Sum of Areas Lisp?

    I'm confused...... this feature is built into the area command already.

    atleast it is in 2005.


    straight from the help file...


    Add
    Turns on Add mode and keeps a running balance of the total area as you continue to define areas. The Add option calculates the individual areas and perimeters of defined areas and objects as well as the total area of all defined areas and objects. You can use the Subtract option to subtract specified areas from the total area.

    Specify first corner point or [Object/Subtract]: Specify a point (1) or enter an option

    First Corner Point

    Calculates the area and perimeter you define by selecting points. All points must lie in a plane parallel to the XY plane of the current UCS.

    Specify next corner point or press ENTER for total (ADD mode): Specify a point (2)

    Specify points to define a polygon (3). Press ENTER. AutoCAD calculates the area and perimeter and returns the total area of all the areas defined by selecting points or objects since Add mode was turned on.

    If you do not close the polygon, AutoCAD calculates the area as if a line were drawn from the last point entered to the first. When calculating the perimeter, AutoCAD adds that line length.

    Object

    Calculates the area and perimeter of the selected object.

    (ADD mode) Select objects:

    AutoCAD calculates the area and perimeter and returns the total area of all the areas defined by selecting points or objects since Add mode was turned on.

    If you select an open polyline, AutoCAD calculates the area as if a line were drawn from the last point entered to the first. When calculating the perimeter, however, AutoCAD ignores that line.

    The centerline of a wide polyline is used to make area and perimeter calculations.

    Subtract

    Turns on Subtract mode and keeps a running balance of the total area as you subtract specified areas.

    Subtract
    Similar to the Add option, but subtracts areas and perimeters.

Page 1 of 2 12 LastLast

Similar Threads

  1. Can't tag areas???
    By jon.200969 in forum Revit Architecture - General
    Replies: 5
    Last Post: 2017-03-29, 04:17 PM
  2. LISP PARA SACAR AREAS EN UNA TABLA O EXCEL
    By luisito_210675 in forum AutoCAD General
    Replies: 0
    Last Post: 2014-06-11, 09:09 PM
  3. 2014: Double Areas
    By nicholas.widas536921 in forum Revit Architecture - General
    Replies: 2
    Last Post: 2014-02-06, 09:14 PM
  4. Phasing Areas
    By mccourtl in forum Revit - Platform
    Replies: 2
    Last Post: 2011-04-27, 12:58 PM
  5. Areas - Removing Columns from Floor Areas
    By ddavison.33993 in forum Revit Architecture - General
    Replies: 3
    Last Post: 2006-02-18, 02:39 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
  •