Search code examples
autocadcaddxf

Is there a way to manually calculate entity length from a dxf file?


This is my Entities section of a project which had only one entity,an ellipse.

0
SECTION
2
ENTITIES
0
ELLIPSE
5
4D
100
AcDbEntity
8
0
6
ByLayer
62
256
370
-1
100
AcDbEllipse
10
52.75
20
65
30
0
11
0.25
21
-44.25
31
0
40
0.508841366102777
41
0
42
6.283185307179586
0
ENDSEC

The total length of this ellipse entity was 234.607 . When I look at the code, I understand that it is telling me that the .dxf file has just one entity,an ellipse but what does it tell me about the total length? I mean, can i somehow calculate the total length just be looking at this section, if yes,then how?

I know we can otherwise how does the software calculate it? It analyses this section for getting the total length,right?


Solution

  • 234.607 seems to be the area, not the length.

    In your DXF file, codes 10 to 30 are the coordinates of the center (52.75, 65), codes 11 to 21 the coordinates of the end point of the major axis (0.25, -44.25) and code 40 is the ratio minor radius/major radius (0.508841366102777).

    With these informations, you can compute the arc length of your ellipse (which is not easy) or the area (which is PI x a x b, where a = major radius and b = minor radius).