Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

get coordinates of a line in 2d from dxf file 1

Status
Not open for further replies.

civil2013

Structural
Feb 27, 2005
24
Hi all, I have a drwing in .dxf format. its a 2d line sketch. The drawing has only 2d lines. It is basically the center line (through the wall) for the plan of a building. I wish to get the start and end coord of each line in this drwaing. i am using AutoCAD LT 2020. Is it possible to get this by opening the DWF file in notepad. i do not wish to use lisp addins. I wish to write a script which can extract the information from the DWF file. i am attachingn the DWF file here. thanks
 
 https://files.engineering.com/getfile.aspx?folder=60043ea8-fc18-4cab-b2d2-36a899541985&file=edited_line3.dxf
Replies continue below

Recommended for you

Yes but it you uploaded a DXF file not a DWF file.

In the DXf file, search for the keyword "LINE"
After that there are lines that begin with 10, 20, 30 and 11, 21, 31 which are as follows:
10 beginning X coordiate
20 beginning Y coordiate
30 beginning Z coordiate
11 ending X coordiate
21 ending Y coordiate
31 ending Z coordiate

For example, this line starts at (-344.799,201.464,0.0) and ends at (-287.761,201.464,0.0)
AcDbLine
10
-344.7994650353352
20
201.4641462477805
30
0.0
11
-287.7617250353353
21
201.4641485227083
31
0.0
 
One doubt, should i be searching for 'LINE' or 'AcDbLine' . If i extract the line one after the 'AcDbLine', i believe i will get the coordinates. Correct me if wrong
 
Correct, prove it to yourself by creating a DXF file from a drawing that has only one line in it.
 
I don't have ACAD2020 but in my ACAD2005 I can convert dxf files to dwg files as follows: Tools>Options>dialog Box Open and Save tab>save as :*dwg.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor