Import Text from Excel to AutoCAD

Excel formula to import text into AutoCAD

In this blog post, I will explain about an ‘Excel formula’ that can be used to ‘Import Text from Excel to AutoCAD’.

Suppose you have some data like the following that needs to be inserted into AutoCAD.

The texts to be inserted into AutoCAD are in the column C and the X,Y Co-ordinates of the insertion points are in the columns A and B.

Using an Excel formula we can convert this data into an AutoCAD friendly form, which when pasted in the command prompt of AutoCAD will create 10 Text objects.

Create a Text object from the Command prompt

First of all, let me show you how to create a Text object from the command prompt of AutoCAD.

To create a text ‘XL n CAD‘ of height ‘10‘ at the point ‘200,350‘ rotated at ‘25°‘,

Type in -TEXT in the command prompt of AutoCAD and press the Space bar.

AutoCAD will ask for the ‘start point of text‘ otherwise the insertion point of the text. Type in 200,350 and press the Space bar.

Now we have to ‘specify the height of the text‘. Type in 10 and press the Space bar.

Next parameter is ‘rotation angle‘. Type in 25 and press the Space bar.

The last parameter is the ‘content for the text object‘. Type in XL n CAD and press the Enter key.

and we have the text XL n CAD of height ‘10‘ at ‘200,350‘ with a rotation of ‘25°

From the command prompt we can deduce that the syntax to create a Text object from the AutoCAD command prompt is the following.

-TEXT X,Y Co-ordinates Height Rotation Content

Formula to import Text from Excel to AutoCAD

Now, back to our data. We have the text to be inserted in the column C and the corresponding X,Y Co-ordinates in columns A and B.

To insert the text KITCHEN of height 10, into the point 77192.044, -12796.478 with rotation, the statement should be

-TEXT 77192.044, -12796.478 10 0 KITCHEN

So, I will use CONCATENATE function in Excel to join the data in the column A, B & C.

=CONCATENATE("-TEXT ",A2,",",B2," 10 0 ",C2)

Explanation of the formula

The cells ‘A2 and ‘B2‘ have the co-ordinates of the text KITCHEN in the cell C2. ‘10‘ is height of the text and ‘0‘ is the rotation.

Copy the concatenated data and paste it into the command bar of AutoCAD.

[optimize output image]

Text that are listed in the Excel file got inserted into the specified points.

The same method can be used to insert hundreds and thousands of Text objects into AutoCAD drawings.


Scripting in AutoCAD

Read on Macros in AutoCAD

Tips and Tricks in AutoCAD

Command Alias in AutoCAD

Complete list of AutoCAD Commands