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!

reading coordinates from autocad

Status
Not open for further replies.

kr276

Structural
Sep 30, 2018
9
Hi, I am to write a code in FORTRAN which can calculate the section properties of any arbitary shape. The idea is to draw the section in autocad and then mesh (or hatch) it with user defined option (square meshes of unit size). my program is supposed to read the cad file, get the coordinates of these meshes (or hatch) and calculate the section properties (ie; Area, section modulus etc). i know that cad has option region>massprop> to get this, but i dont have full option cad, hence looking to develop this program. i wish to know if any one has good ideas on this. is it possible to read the coordinates of mesh from autocad file (if saved in a different format - dxf, ascii etc which can be open in notepad for reading)
 
Replies continue below

Recommended for you

I assume you have AutoCAD LT or similar if it doesn't have the MASSPROP command. So then you also couldn't use a lisp routine to simplify an extract of coordinates.
You should be able to pull the coordinates from a dxf file. Create a simple file with a hatch and look through the dxf file. You'll have to get familiar with the dxf codes for objects. A polyline around the section might be easier to read than a hatch, not sure.
 
hi @carlB, your comments is appreciated. but i am struggling with dxf. unable to precisely get the coordinates from this...anyway, thanks for your comment
 
You can find the structure of DXF files with a quick google search. If you try that and still have questions, come back here.
 
I was able to right click on a 2010 ACAD Lt dxf file. At "Open with", I was able to select Notepad, and the file opened with all the coordinates in text format.
 
Here is a thought. If Fortran can read script, then write your program in script which should be able to identify the coordinates of the meshes. If you can download the ACAD program in the 2005,2002 or 2000 version ) on this site so that I can look at the mesh structure to get an idea on how the mesh can be identified with coordinates. If you can insert points within the mesh, then the coordinates of those points will be listed in reference to the UCS when you pick those points. To ease the selection of those points, put them in one layer then you can turn off all other layers and the points will show up when you command to list and requires you to select the objects, ie, the points.
 
Here is a correction to my reply"... then you can turn off all other layers and the points will show up on the screen. When your command to "list" requires you to select the objects, ie, the points, it should be relatively easy to pick the points."
 
I've never used attributes but you could use them to identify each point (a big chore), then later extract them.
Did "Notepad" open a dxf for you?
 
The DXF file has a structure, each entity is identifies with coordinates and other identifying attributes ( ie radius for a circle, etc ). It is a pure ASCII text file and can be read by any word processor or text editor. You don't need the mesh objects, just the coordinates defining the shape. If you have a general idea of the shape you can write a program to open the file, read the coordinates and calculate the section properties. Don't make it harder than it is!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor