There are many ways to input commands into AutoCAD®. You will be familiar with the command line as the main method for driving AutoCAD®, any you will most likely know that toolbars are usually just shortcuts to commands that are in fact sent to the command line. Understanding how AutoCAD® accepts input from the command line allows us to invent our own ways of inputting data, and one of the most useful ways is to copy and paste commands directly into the command line.
Copy and paste this list of commands into the command line:
LINE 0,0 30,45 LINE 30,45 60,77.9422863405995 LINE 60,77.9422863405995 90,90 LINE 90,90 120,77.9422863405995 LINE 120,77.9422863405995 150,45 LINE 150,45 180,1.10263360941776E-14 LINE 180,1.10263360941776E-14 210,-45 LINE 210,-45 240,-77.9422863405995 LINE 240,-77.9422863405995 270,-90 LINE 270,-90 300,-77.9422863405995 LINE 300,-77.9422863405995 330,-45 LINE 330,-45 360,-2.20526721883552E-14
You should now have a rather coarse looking sine wave which was drawn by a series of LINE commands. “What’s the point of that” you say? Well the drawing of a sine wave is just an arbitrary example of copy and pasting commands directly into the command line. Where this concept really comes into it’s own is when we use Excel to create the list that we copy. Here’s how I created the list above:
The method for creating the coordinates is unimportant – what you should focus on is the formula for creating the command:
="LINE " & E3 & "," & F3 & " " & E4 & "," & F4 & " "
Using a bit of concatenation of cells with the ‘&’ operator, we can make the content of cells represent a command in AutoCAD®, which we can then later copy and paste into AutoCAD®. Taking this further you can string a few commands together for each row of data, allowing you to achieve more complex tasks than drawing a simple line. So if you had a few coordinates for say manhole locations, and each had an associated ID number, you could quite easily create a formula to firstly input a circle at the correct location, and then insert some text at the same location with the ID number. If you have a block, use the INSERT command in your formula instead. The possibilities are endless. I’ll never forget the time that I had to produce a tree survey based on a huge list of coordinates and other information in Excel. We’d budgeted for a fair amount of work, but with a bit of knowhow it was as easy as copy and paste.
I hope you found this tip useful, and if you did I would like to recommend you subscribe below. I’ve got loads more tips to share!