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 data from autocad 1

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)
 
Replies continue below

Recommended for you

If you have AutoCAD, you can save the file in DXF format, which is an ASCII text file relatively easily deciphered. Perhaps that could help you?
 
@IFRs, is there a way to get that information from the ASCII text file... the text file looks very confusing. is there a key word to search inside the text file, to understand what follows this is what we are looking for.. thanks for your comments
 
As far as I know, Autocad still supports VBA. If it does it should be fairly straightforward to read shape properties from Autocad using Excel. You could then do the section properties calculations in VBA, or link to a Fortran dll. Or you might like to look at this Python program:
which can also be called direct from VBA.

Doug Jenkins
Interactive Design Services
 
Hi IDS, thats exactly what i was looking for.. i dont know python. i have done stuff only with fortran...i have used lapack/blas package in fortran while trying to do modal analysis of structures.. i belive there should be some equivalent options in fortran too.. thanks for your help.. this link should take me further.. if u have/seen similar things on fortran, please let me know
 
Well...I'm an 'old' Fortran programmer too...but I must say...there are much better and easier ways transfer Data between autocad and other programs than using Fortran
Also I think Autocad can calculate all section values already.... why not use that ?

Winteracter is an addon to Fortran which allows to do many thinks....which is not part of Fortran
I use Winteracter addon often to write small Fortran programs





 
Hi Klaus, understand that full version autocad has that capability. but i am using demo version of draftsight - which does not give all the section properties. So, i am planing to write this code which should mesh the cad drawign and then get the required section props
 
kr276,

It has been a while since I have used AutoCAD. Doesn't it extract area and the moments of area from an enclosed polyline? If your drawing is not an enclosed polyline (i.e. just a bunch of lines and arcs), can you extract data from it?

--
JHG
 
Hi drawoh, the area necessarily need not be polyline... ideally, i just get a drawing prepared by third party and my requirement is to calculate the property.i am not sure (of what you have mentioned) whether its possible on demo version of cad/draftsight
 
kr276,

If your form is not an enclosed polyline, your program will have to inspect the outline to assure it is properly enclosed. That could be the biggest programming challenge. You can convert a sketch to an enclosed polyline.

--
JHG
 
kr276:
You are correct mine just takes a closed 2D polyline based on x,y coordinates and uses standard equations for the section properties, mine doesn't have the ability to compute the torsional properties J, etc. or handle openings or multiple shapes.

For what your looking to do IDS's spreadsheet would probably work best which I believe is based on Handofthelion's python program,
Extracting the data from AutoCAD, assuming your demo period runs out, would be easiest to do if you can have whoever is supplying you the file convert it to DXF this will make it much easier to parse and extract the coordinates directly using your own program.

As drawoh notes if your not getting closed polylines in the DXF file your biggest challenge will be converting all the lines into an actual closed shape to then mesh.

Open Source Structural Applications:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor