×
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

Excel to draw in AutoCAD

Excel to draw in AutoCAD

Excel to draw in AutoCAD

(OP)
I am looking to produce profiles, cross sections etc in AutoCAD by inserting a line of commands from an excel spreadsheet.  How exactly is it done?  

RE: Excel to draw in AutoCAD

Are you trying to enter AutoCAD commands one by one (like a script) or trying to get the parameters for creating these objects?

RE: Excel to draw in AutoCAD

Years ago, I was able to link Autocad and Excel so for instance, the flange length, web height and both thicknesses were in Excel cells as values, like 4.5 and 0.25 and the Autocad drawing would change if the Excel cell values changed.  It was a two-way link so if I stretched the I-beam flange, the cells in Excel would change.  I used it to calculate beam properties and strengths in Excel for various sections in Autocad.

Is this similar to what you are trying to do?

RE: Excel to draw in AutoCAD

(OP)
I have not used it in the two way manner described for the flange.  This sounds a little more complex than what I have done.  I would be very interested to know how you did this.  What I have done is to copy a column (highlight total column) of command figures produced in excel and paste into AutoCAD command line to produce a grahical representation of elevations (a cross section or profile) with grid etc.  Hope we can figure this out as it is very useful.

RE: Excel to draw in AutoCAD

Piece of cake with and Excel Macro. Here is how you can use a button to process each command in the column.

From your Excel WB:
1: View > Toolbars > Control Toolbox
2: Select the Command Button from the toolbar and
   draw one on the worksheet
3: Double-Click the button (fires up VB Editor)
4: Add this code

Sub RunAutoCADCommands()
    Dim iRow As Long
    Dim sCmd As String
    'Connect to AutoCAD
    Dim cadApp As Object
    Dim cadDoc As Object
    Set cadApp = GetObject(, "AutoCAD.Application")
    Set cadDoc = cadApp.ActiveDocument
    'Issue Commands
    iRow = 1
    Do While Range("A" & iRow) <> ""
        cadDoc.SendCommand (Range("A" & iRow))
        iRow = iRow + 1
    Loop
    'Done
    MsgBox "Done Processing Commands"
    Set cadDoc = Nothing
    Set cadApp = Nothing
End Sub

NOTE: This processes all commands in column A, starting with row 1. Modify as needed.
5: Switch back to the worksheet. You can highlight the button, select Properties from the toolbar to change the name displayed.
6: Exit Design Mode (a button on the toolbar)
7: With a drawing open in AutoCAD, hit the button.

Hope that helps...

DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.

RE: Excel to draw in AutoCAD

Oops! The Sub name should not be added. The sub will automatically come up with something like this:

Private Sub CommandButton1_Click()

End Sub

Just put the code in this sub, rather than RunAutoCADCommands().

DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.

RE: Excel to draw in AutoCAD

Malakin,
If I understand you correctly, you have columns for an X & Y coordinate points. There is a simple way to paste these into Acad to create a pline to draw a cross-section or profile that doesn't involve lisp routines.
1) using concatenate or & in excel create a column with "x,y" in a text format. (eg. =A1&","&B1)
2) copy the entire column for the profile or cross-section
3) start a pline command in Acad
4) go to the text window (F2), under EDIT hit PASTE.
cross-section drawn.

RE: Excel to draw in AutoCAD

Is there a way to use this same methodology to Autocad blocks through excel.
For example:

Using Excel as a database which can update drawings that have the associated links through the blocks.

Idea is that what you update in excel, it will update all the other drawings where blocks are linked to the excel. Similiar to the Xref.

another example

-Excel Data Sheet
 |
  - Drawing 1 _ Plan Drawing
      |
       - Text linked in a block attribute to Excel Sheet
  - Drawing 2 _ Profile Drawing
      |
       - Text linked in a block attribute to Excel Sheet
  - Drawing 3 _ Details
      |
       - Text linked in a block attribute to Excel Sheet
  - Drawing 4 _ Tables
      |
       - Text linked in a block attribute to Excel Sheet

All Driven by Excel and Attribute Blocks.

Maybe the block setup could be a genearic type block. All we need to put in the attribute area is the approperate Excel Cell (A11) and that value will show up in the autocad block attribute drawing.

RE: Excel to draw in AutoCAD

You would probably have to write a program to create the dynamic link. I do not think that they can be linked without customization.

DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.

RE: Excel to draw in AutoCAD

How hard would it be to write this program. Do you think this is a easy program? Do you think there are already programs out there that can do this? so using vlisp and macros... not possible?

thanks...

RE: Excel to draw in AutoCAD

It is not extremely complicated, but it's not an simple task either. It would take some time to configure and write. I am not sure if anything like this already exists, but it is possible with VBA.

DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.

RE: Excel to draw in AutoCAD

You can use this as an example: (Replace the word "dot", used twice, with an actual ".")
http://www.geocitiesdotcom/flores_2793@sbcglobaldotnet/Points.xls
Start a new drawing, then copy what is in the red box only and paste it at the command line.  By seeing how this is done, you can get an idea of how to draw other things from Excel.

Flores

RE: Excel to draw in AutoCAD

Thank you will give it a go...

RE: Excel to draw in AutoCAD

I do like how everything is automated with the excel... Even survyors could use this... does this method work with connecting lines?

but

can autocad attributes be linked to a ACCESS database or excell...

I know if you paste the excel cell into autocad and you go to plot... looks pretty crappy... but if its in a block its clean..

any ideas?

RE: Excel to draw in AutoCAD

http://myhome.hanafos.com/~xout/Excel/Excel_Funtion_list.htm

Visit above site then u can find out what u want.
That is what exactly u want !

Unlucky it is written in Korean !
So I just wish there is Korean friend near u ~

That public free software can only operate in ACAD 2000
Made it with LISP !

RE: Excel to draw in AutoCAD

lol i can not get the link from there site to download the LISP...  but yes it does sound like something that will work!

RE: Excel to draw in AutoCAD

will give it a try... lol

Link is not working again...

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