Text Table Import to AutoCAD

By on August 5, 2009

A screen image of Excel showing the test data.I have long bemoaned the absence of any support for tabulated text in AutoCAD, and so have many other people. It is a common need to place tables of textual information on drawings. The only obvious method appears to be to use a mono-spaced font and space out the columns with multiple spaces, which is not very satisfactory.

Some users create their tables in Microsoft Excel and then paste a selected region of the Excel table into AutoCAD as an OLE linked object. That has its problems. If you use a black background, as most AutoCAD users seem to do persist with, despite my advice, then the Excel table with its white background looks a bit odd. But, more seriously, Microsoft’s OLE mechanism in Windows is far from reliable, has severe limitations on the amount of linked data, and is a serious resource hog. I have always recommended AutoCAD users to avoid OLE if possible, and it usually is.

I only found out recently from a long-time user of AutoCAD that it is possible to import Excel table data quite satisfactorily as AutoCAD text. To prove this and explain the options, I made a test table in Excel by cutting some text out of part of the ACAD.PGP file and editing it with tabs so that it would paste into Excel in rows and columns. The illustration here shows three ways at pasting it into AutoCAD. After selecting the cell range in Excel and copying it to the clipboard by Ctrl-C, I opened AutoCAD and used the Edit menu, Paste Special. The resulting dialog box, shown here, presents several options of the form in which to paste the clipboard data.

The Paste Special dialog boxMethod 1 used the ‘Paste as text’ option. The result is a single ‘Multiline Text’ object, with each row of Excel cells as one text line with hard line-end, but with all the column spacing lost. That’s not much use as a text table. Also, even though pasting Word text into AutoCAD’s Mtext dialog-editor preserves the fonts and formatting nicely, this operation ignored the Excel text format and inserted it as the current AutoCAD Style, which in my test used the awful-looking TXT.SHX font that is still AutoCAD’s default for its Standard Style.

Method 2 used the ‘Paste as Picture (Metafile)’ option. This gives quite a good result, more so if you use a white background in AutoCAD, but you cannot edit it in any way at all. If the table neded altering you’d ave to alter it in Excel, delete the present AutoCAD insertion and paste the picture again.

Method 3 is the most satisfactory, I think. This used the option that surprised me: ‘Paste as %PRODUCT entities’. I cannot find any reference to any such type of entity. It inserts the cells each as a separate ‘Single-line Text’ object, and automatically organises the insertion points of the text objects vertically and horizontally to form a sensibly arranged table. It also, and rather surprisingly, creates new Text Styles to reproduce the format of the Excel text! In my test, which used Excel’s default Arial font and size, but with the header row in bold, the pasted text objects used new Styles called ‘WMF-Arial0’ (for the top row in bold) and ‘WMF-Arial1’ (for the other cells).

A partial screen capture of AutoCAD showing 3 ways of pasting Excel data from the clipboard.I also tried it with one of the cells set up in Excel with wrapped multi-line text. This pasted into AutoCAD with each wrapped line as a separate single-line text object. It spaced the adjoining cells appropriately even though they had only single-line text in them.

This method allows for some minor text editing in AutoCAD, since the text is ordinary text. If the editing widened a cell of text so that it overlapped, you’d have to manually move all the other cells around to make room and keep the tabular format. For any serious alterations, it would be better to delete all the pasted text objects, edit the Excel data, and redo the copy-paste operation.

So, this ‘Paste as %PRODUCT Entities’ facility provides a quite useable text table mechanism. The odd thing is that it seems to be a bit of a secret.

About Geoffrey Harrod

Geoff Harrod – BA, Grad. Diploma Information processing (UQ)
Experience with many CAD products since 1980.

Former AutoCAD system developer, university CAD lecturer, technical editor of MultiCAD Magazine and contributor to many other CAD publications.

Authorised reseller & trainer for Cadsoft , TurboCAD and progeCAD.

One Comment

  1. wPromoJohnow

    September 17, 2012 at 10:19 am

    http://www.google.com Interesting. Will defintely be back

Leave a Reply

Your email address will not be published. Required fields are marked *