Wednesday, November 28, 2007

Getting Excel into AutoCAD

There are many times when it is necessary to import spreadsheet data into AutoCAD. This is easily accomplished with the standard Windows tools CUT and PASTE. However there are limitations to the quality of the inserted data. The OLE insertion is neither editable nor linkable (correction: it IS linkable, see comments). The technique in this write-up allows for both.

CUT and PASTE SPECIAL

1. Create Excel file as you normally would.
2. Select the rows, columns and cells that you want to insert into your AutoCAD drawing.
3. Right-click and select Format Cells. In the FONT tab, ensure that the “Normal Font” box is checked solid (not grayed out). See Figure 1.

  • Note: If you intend to keep the original Excel spreadsheet format, do NOT save the spreadsheet after this step.

  • Correct way

    Incorrect way

    Figure 1: Format Cells


    4. Click OK and then copy selection (right-click > Copy or CTRL-C)
    5. In AutoCAD, if not already done, set up your TABLE per standards. This includes text style, height, color and alignment. Column and row settings do not matter, as this technique allows for small or large spreadsheets.
    6. Select Edit > Paste Special. (Figure 2)


    Figure 2


    7. Choose “AutoCAD Entities” (Figure 3)


    Figure 3: The Paste Special Dialog Box

    8. The only thing that needs to be done is to apply the Title and Header properties. This is easily done with the following steps:
  • Create a new temporary table.
  • Activate the Title or Header cell.
  • Right-click and select Match Cell.
  • Click appropriate cell in inserted table.
  • Delete temporary table
  • 2 comments:

    Ward Romberger said...

    Great new blog John.

    As much as OLE improves with each release of AutoCAD, I'm still not a big fan. OLE has its own special considerations that are not immediately apparent: plot quality, size, fonts, speed, etc. However, it is possible to insert a linked OLE spreadsheet. Paste Special (command PASTESPEC) as Microsoft Office Excel Worksheet with the Paste as Link radio button selected.

    Use Edit > OLE Links... (command OLELINKS) to change the source, break the link, or force an update.

    John said...

    Ya, I figured that out a couple days after posting this (I just hadn't gotten around to editing or adding another post yet). Thanks for mentioning that.

    But as you said, the print quality can be lousy, and there's no edit in place allowed. I simply don't like the rigidity of OLE.

    Thanks for your comment!