TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: dwaschnia on December 22, 2022, 05:41:29 AM

Title: Polyline area value
Post by: dwaschnia on December 22, 2022, 05:41:29 AM
Hi,

does anyone know why I get 2 different values for the area of the polyline (attached dwg) when I click on it and when I select it with this code: (vla-get-area (vlax-ename->vla-object (car (entsel)))) ?
(see also attached image for clarification)
Title: Re: Polyline area value
Post by: Lee Mac on December 22, 2022, 08:20:05 AM
It's likely the self-intersecting areas of your polyline - using the AREA command with the Object option, I receive an output different to both of your examples.

You can prove this by exploding the polyline, trimming/removing the overlapping lines to leave the 'islands' and then converting the result to a region:

(http://lee-mac.com/swamp/region.png)

Such region then has a consistent area of 805.4531.

Title: Re: Polyline area value
Post by: didier on December 22, 2022, 03:30:42 PM
Bonjour

By reconstructing the perimeter and the islands in separate polylines then by making a hatching with choice of objects we obtain the value of 805.4331.
When you ask the properties of the polyline in the deposed drawing, AutoCAD don't give the value of the area.
It is a good indication of polyline defect.
see the image of the two polylines
Amicalement