×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Importing from a program (Excel) to AutoCAD

Importing from a program (Excel) to AutoCAD

Importing from a program (Excel) to AutoCAD

(OP)
What options are there to import a set of data into autoCAD either as a dxf or have autocad draw it.

Basically I would like to have a graph that was created in excel be a polyline in autocad but thats not all. I would also like a grid to be drawn as well. I know that I can write scipts for the graph poly lines and probably for the grid as well but are there other ways?

How do programs that export there 'drawing' or 'data set' to excel operate? How are they communicating with AutoCAD?

This may be a pretty involved topic so maybe a reference would be most helpful. I know almost nothing about LISP's would it be help to start here or maybe there is a way to use VB/Macro's in excel?

Thanks!

EIT

RE: Importing from a program (Excel) to AutoCAD

I can do that in Turbocad in about three clicks of the mouse.

Try using the "file insert" function if supported in AC

RE: Importing from a program (Excel) to AutoCAD

You can download and install a very useful utility from www.scriptsheets.com. A simple fix for people who don't have "file insert" and can be set-up to provide very detailed drawings from calculated results in Excel.

Enjoy...

RE: Importing from a program (Excel) to AutoCAD

(OP)
Thanks guys!

I'm not sure how I can you use the file insert or input commands. I mean you can insert different files but I'm not sure how to create those files. Also I'm not trying to show the actually sheet. I am basically drawing an object (like a graph) with excel functions and wanting the result to be drawn in autocad.

Cherrypicker - thanks this may prove to be a solution.

I am still curious though how do other programs communicate their outputs with AutoCAD? Usually I see they are imported as .DXF files.

EIT

RE: Importing from a program (Excel) to AutoCAD

It sounds like you are wanting to import the data points in X,Y format so AutoCAD connects them with a continuous line.  This is not hard.  Of course if you are just looking to have the Excel chart in CAD, you can use Copy/Paste.

RE: Importing from a program (Excel) to AutoCAD

(OP)
IFR's yes I want autocad to connect lines in X,Y format. I currently have a couple scripts for a couple of poly lines but I'd like to expand on this. When you say this is not hard are you referring to scripts?

Ideally I would like to be able to define the line types, color, even add text or a leader line. Now I'm guessing I wouldn't be able to do all that in excel but do you know of a different program or how I could use to create such a program? I guess this is almost getting into software creation.   

EIT

RE: Importing from a program (Excel) to AutoCAD

If you learn the syntax of the dxf file you can do just about anything.  For instance, in cad, create a sample, then use DXFOUT or SaveAs DXF and open the DXF file in Notepad.  You will see the various codes that define layers, colors, etc.  Essentially you can make a dxf file that is almost anything.

RE: Importing from a program (Excel) to AutoCAD

(OP)
IFR's - aaahh, yes. I should have thought of that. Another good leed. I am not very familiar with many coding languages. I have some experience with php but I image this is a different animal.

Any suggestions on where to start with this, any references?

Basically I have a series of data points that are the result of excel equations. I need to take this information and get it to excel. I'm just struggling on how to put this all together.   

EIT

RE: Importing from a program (Excel) to AutoCAD

Google

RE: Importing from a program (Excel) to AutoCAD

I have not personally tried it, but it should, in theory, be possible to make Excel generate a proper DXF file, given that a DXF file is a text file containing no binary information, and the file  format is documented.

I will volunteer a little caution about the effort.  Autodesk's supporting information for DXF makes some sly digs at competitive products, stating that a program that must read DXF files as input should be flexible about the order and format in which DXF elements are presented, because according to the documentation, there should be several legitimate ways to organize the information in a DXF file.

Ironically enough, AutoCAD itself is one of the more fussy readers.  It is possible to generate DXF files that other CAD programs can read without error, and which AutoCAD will barf upon.

So the most logical way to proceed is to generate a nearly-null DWG file in AutoCAD, e.g. something with just one line, export it from AutoCAD as a DXF, and then use that as a template for what Excel must generate.  In particular, you can capture and 'can' the required preamble and postamble generated by AutoCAD, and set up Excel to spit those out from fixed files, or to generate preamble and postable in exactly that format, and to interpose the geometry you wish to export in the documented way.

Good luck and have fun.
 

Mike Halloran
Pembroke Pines, FL, USA

RE: Importing from a program (Excel) to AutoCAD

(OP)
Thanks guys. It should be interesting. I have always been intrested in coding and software development so hopefully I can learn something here.

I'm still debating whether to write a fairly involved script or try and generate a dxf file. I believe in the long learning the how to generate a dxf file will be more useful.  

Just a little background on where this stems from - there are a couple different segmental block retaining wall manufactures that have software which allows you to enter top of wall and bottom of wall points. This then automatically generates the retaining wall which you can export to a pdf with some notes and a grid, etc. I would like to develop something similar but this does not need to be its own program as it would be for my use only.
I wonder if it would be worth while to use a programming language and try do the whole thing in a program editor..hhmmm...

EIT

RE: Importing from a program (Excel) to AutoCAD

I have written many routines in Basic, QBasic, etc to create complete drawing dxf files.  Once you get used to the syntax, it is tedious but not hard.

RE: Importing from a program (Excel) to AutoCAD

(OP)
IFRs -

Please forgive my terminology and general lack of knowledge here:

In excel I have equations which result in different x,y values for different poly-lines. Can I then write a program using VBA in excel to pull these vales from the worksheet and into the code/syntax needed to create the dxf file?
Or is there a better way to do this?

Also is there any particular resource that you would suggest. It sounds like saving a DXF file and analyzing it is a good way to go also I found the autocad dxf referance manual:
http://images.autodesk.com/adsk/files/autocad_2012_pdf_dxf-reference_enu.pdf

Thanks again

EIT

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources