0

I need total length and width of whole sheet Like below Length - 602 width - 938

enter image description here

i checked with DXF file format reference document i didn't got any clue. can anyone knows about this calculation or code.

 0
SECTION
  2
HEADER
  9
$ACADVER
  1
AC1024
  9
$ACADMAINTVER
 70
   109
  9
$DWGCODEPAGE
  3
ANSI_1252
  9
$LASTSAVEDBY
  1
haresh.patel
  9
$INSBASE
 10
0.0
 20
0.0
 30
0.0
  9
$EXTMIN
 10
-93.00730087511951
 20
-51.69399222749615
 30
0.0
  9
$EXTMAX
 10
1072.189249192752
 20
688.3170963457955
 30
0.0
  9
$LIMMIN
 10
0.0
 20
0.0
  9
$LIMMAX
 10
12.0
 20
9.0
  9
$ORTHOMODE
 70
     1
  9
$REGENMODE
 70
     1
  9
$FILLMODE
 70
     1
  9
$QTEXTMODE
 70
     0
  9
$MIRRTEXT
 70
     1
  9
$LTSCALE
 40
1.0
  9
$ATTMODE
 70
     1
  9
$TEXTSIZE
 40
0.2
  9
$TRACEWID
 40
0.05
  9
$TEXTSTYLE
  7
Standard
  9
$CLAYER
  8
0
  9
$CELTYPE
  6
ByLayer
  9
$CECOLOR
 62
   256
  9
$CELTSCALE
 40
1.0
  9
$DISPSILH
 70
     0
  9
$DIMSCALE
 40
1.0
  9
$DIMASZ
 40
1.0
  9
$DIMEXO
 40
0.0
  9
$DIMDLI
 40
0.0
  9
$DIMRND
 40
0.0
  9
$DIMDLE
 40
0.0
  9
$DIMEXE
 40
0.0
  9
$DIMTP
 40
0.0
  9
$DIMTM
 40
0.0
  9
$DIMTXT
 40
8.0
  9
$DIMCEN
 40
2.5
  9
$DIMTSZ
 40
0.0
  9
$DIMTOL
 70
     0
  9
$DIMLIM
 70
     0
  9
$DIMTIH
 70
     0
  9
$DIMTOH
 70
     1
  9
$DIMSE1
 70
     0
  9
$DIMSE2
 70
     0
  9
$DIMTAD
 70
     1
  9
$DIMZIN
 70
     8
  9
$DIMBLK
  1

  9
$DIMASO
 70
     1
  9
$DIMSHO
 70
     1
  9
$DIMPOST
  1

  9
$DIMAPOST
  1

  9
$DIMALT
 70
     0
  9
$DIMALTD
 70
     3
  9
$DIMALTF
 40
0.03937007874016
  9
$DIMLFAC
 40
1.0
  9
$DIMTOFL
 70
     1
  9
$DIMTVP
 40
0.0
  9
$DIMTIX
 70
     0
  9
$DIMSOXD
 70
     0
  9
$DIMSAH
 70
     0
  9
$DIMBLK1
  1

  9
$DIMBLK2
  1

  9
$DIMSTYLE
  2
PRAKASHDIM
  9
$DIMCLRD
 70
     2
  9
$DIMCLRE
 70
     2
  9
$DIMCLRT
 70
     4
  9
$DIMTFAC
 40
1.0
  9
$DIMGAP
 40
3.0
  9
$DIMJUST
 70
     0
  9
$DIMSD1
 70
     0
  9
$DIMSD2
 70
     0
  9
$DIMTOLJ
 70
     0
  9
$DIMTZIN
 70
     8
  9
$DIMALTZ
 70
     0
  9
$DIMALTTZ
 70
     0
  9
$DIMUPT
 70
     0
  9
$DIMDEC
 70
     1
  9
$DIMTDEC
 70
     2
  9
$DIMALTU
 70
     2

this is only few part of that dxf file entity

Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
  • All you have shown is bits of the header section of the DXF file. You could find yourself a DXF oarser library which may well have built in tools to do what you want. Otherwise you have to manually parse the entities and work it out. – Andrew Truckle Dec 22 '20 at 12:34
  • @AndrewTruckle is right, The header does contain extmin and extmax but this is not guaranteed to be accurate to the bounds of your document, not at all. -- Your best bet is to parse through the entities and when you see the x flag, check if it is smaller than your smallest or larger than your largest. This could potentially take some time depending on how large your file is. – CodeJunkie Feb 05 '21 at 03:07
  • @CodeJunkie What’s more, they need to be aware some entities are not stored in WCS coordinates and may need transformation. And if it has complex entities like splines this task would be a nightmare. – Andrew Truckle Feb 05 '21 at 05:18

0 Answers0