Best method for finding area of enclosed and open LWPOLYLINEs and how AREA command works

Best method for finding area of enclosed and open LWPOLYLINEs and how AREA command works

Jonathan_Bell82GXG
Enthusiast Enthusiast
813 Views
6 Replies
Message 1 of 7

Best method for finding area of enclosed and open LWPOLYLINEs and how AREA command works

Jonathan_Bell82GXG
Enthusiast
Enthusiast

I'm trying to figure out the best method for returning the area, given a vla-object representation of an LWPOLYLINE. I understand the AREA command and (vla-get-area) can be used, but I noticed they're not super precise. Is that because they use some sort of integration/Riemann sum approximation method? 

 

I'm working with straight (horizontal & vertical lines), closed and open polylines (2-4 sides), and I could just extract points from the entity association list (which would be more accurate, and an easier way for handling 2 sided open polylines). Would that be the way to go?

0 Likes
Accepted solutions (1)
814 Views
6 Replies
Replies (6)
Message 2 of 7

paullimapa
Mentor
Mentor

(vla-get-area) just like AutoCAD's AREA command should give you the precise area needed.

Perhaps you can demonstrate with a sample dwg where the (vla-get-area) method yields results that are not precise?


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 3 of 7

Kent1Cooper
Consultant
Consultant

@Jonathan_Bell82GXG wrote:

... the AREA command and (vla-get-area) can be used, but I noticed they're not super precise. ....

.... I could just extract points from the entity association list (which would be more accurate, and an easier way for handling 2 sided open polylines). Would that be the way to go?


Can you give an example of "not super precise"?  A drawing with one that (vla-get-area) reports imprecisely?  And how you know it's not precise?

 

Does (getpropertyvalue (car (entsel)) "Area") give it to you any more precisely?  Not need for a VLA object conversion when you do it that way.

 

Extracting points from entity data for a Polyline [and presumably using them in an AREA command?] may be fine if they are always made up of only line segments, but not if there could ever be any arc segments involved.

Kent Cooper, AIA
0 Likes
Message 4 of 7

Jonathan_Bell82GXG
Enthusiast
Enthusiast

Here's what I mean (the command line snippet is from commands performed on the circle):

Jonathan_Bell82GXG_0-1691613029390.png

 

And I meant to get a more precise area value, I would use the points from the association list to directly calculate the area of the square or circle (pi*r^2 or L*W)

 

0 Likes
Message 5 of 7

ronjonp
Mentor
Mentor
Accepted solution

@Jonathan_Bell82GXG 

Double check your areas.. I get the same number as the area command:

 

;; Rectangle edges
(print (rtos (* (getdist) (getdist)) 2 16))
"113982692.8267404" 
;; Pick center of circle and nearest
(print (rtos (setq r (getdist)) 2 16))
"7544.212617584588"
(print (rtos (* pi (* r r)) 2 16))
"178804198.3273709" 

 

 

Message 6 of 7

dbroad
Mentor
Mentor

A few suggestions that I hope you find helpful:

  • Avoid using truecolor for black and white objects.  Use index colors instead. Readability increases exponentially, especially for those of us with dark screen backgrounds.
  • Avoid using numerous text styles, especially avoid ever using fixed height text styles.  If you must use fixed text height styles, never use them in dimension styles. 
  • AutoCAD has limited accuracy. Don't expect distances to be accurate to more than 12 significan't figures.  As you see in the attached revised drawing, the diagonal measurements differ even though you probably used the rectangle command.  The dimensions don't match your labelling. To show the labels, I used an annotative scale of 1"=200'
  • Before assuming built-in features to calculate area are imprecise or inaccurate, set your units accuracy at least as high as your tolerance.  For surveying or constuction applications, for example,no one can achieve the level of accuracy that you are worried about. The built-in functionality has superb accuracy.
  • Be very careful when adding annotation scales:  A scale of 1"=40' shouldn't have a scale factor of 40.

Good luck.

Architect, Registered NC, VA, SC, & GA.
Message 7 of 7

Kent1Cooper
Consultant
Consultant

Double-check not just your areas, but the sizes of your objects.  The radius of that Circle is actually 7544.2126, and that rectangle is actually 10238.8149 x 11132.4107, all three of which numbers disagree with what your Text says.

Kent Cooper, AIA