AutoCAD: Free Samples
We all love getting free stuff. I especially enjoy getting free stuff that’s useful. I remember getting in the mail free sample shampoo packets to try. There was one time I even got different flavored teabags all for free in the mail. Believe it or not AutoCAD version 2.6 (which is as far as I can remember) and versions thereafter have always included free samples. The free samples I’m referring to are the many open source lisp files packaged with AutoCAD adding to the core commands and extending the power of the product. Since these free samples can be easily accessed, they can provide benefits to two groups of AutoCAD users. The first group are those who just want to use AutoCAD as a tool. This group can benefit by knowing about and then implementing the additional commands provided by these free lisp files to help improve product efficiency. The second group are those who want to customize AutoCAD by learning how to code with AutoLISP. This group can benefit by seeing the Autodesk developers’ program. The free sample lisp files can be thoroughly examined to help improve this group’s programming skills.
Before I continue, I would like to illustrate how Autodesk continues to add value to AutoCAD by including more and more of these free sample lisp files.
Figure 1 shows all the lisp files packaged with AutoCAD 2000 when released back in March of 1999. That version included a total of 122 free sample lisp files. Now compared that number with Figure 2 which shows all the lisp files packaged with the current AutoCAD 2023 release. The number has jumped to a total of 149 free sample lisp files.
Granted, there are some duplicate file listings. But this still clearly shows that Autodesk continues to add free sample lisp files to enhance the AutoCAD product. Now to peak everyone’s interest, I would like to introduce four of these free sample lisp commands. One of these goes as far back as AutoCAD version 2.6. But in each case, I’ll first discuss why Autodesk may have included the free lisp file. Then I’ll demonstrate the additional function the lisp file adds to AutoCAD. Finally, I’ll conclude with what came of the free sample function as AutoCAD continued development with newer releases.
ASCII stands for American Standard Code for Information Interchange. It was first published back in 1963 and had its final revision issued in 1986. In short, ASCII provided a standard for an application to generate a text file that can be successfully read by other applications. It supports 26 alphabets (A to Z uppercase and lowercase), numbers (0 to 9) and basic punctuation symbols.
Back in April of 1987 when AutoCAD version 2.6 was released, Autodesk’s flagship graphics application was missing a command to import an external ASCII text file. Since those were still the glory days of the Microsoft Disk Operating System (DOS), there was no such thing as copy and paste or drag and drop. So, Autodesk developers probably wanted to flex their muscles to demonstrate the power of AutoLISP (introduced with AutoCAD version 2.18 in January of 1986); thus, the free sample lisp file ASCText.lsp was born (see Figure 3).
At AutoCAD’s command prompt, entering the following command sequence loads the file: (load “ASCText”)
Note: This assumes that the lisp file is in the AutoCAD support search path; otherwise, the entire folder location would have to be included. Also, since the .lsp file extension is assumed, it does not have to be typed out.
After loading the code, the command prompt lists two methods for launching the added function:
- AT = shorter method for the keyboard challenged
- ASCTEXT = longer method for the exceptionally skilled typist
Then responding to the given prompts, ASCText is able to successfully import into AutoCAD the contents of a text file (in this test case even itself) into the graphics screen using lines of TEXT objects (see Figure 4).
I was also surprised to learn that this old code accepts backslashes (“\”) when a number of current lisp codes require forward slashes (“/”). Lastly, it took spaces in the folder or file name by surrounding the “File to read” entry with quotation marks (“…”).
Seven years and five releases later, the inclusion of the free sample ASCText.lsp was finally dropped in November of 1994 when Autodesk introduced in Release 13 the MTEXT command. MText added a built-in Import Text feature which can be accessed from the toolbar by clicking on the drop down arrow on the right (see Figure 5).
Back in 2001, there was a very popular television series called Alias that was broadcasted on American Broadcasting Company (ABC) for a total of five seasons. Basically this popular show was about a well trained female government agent that assumed various identities or aliases to successfully carry out her missions. I actually think the show was so well watched is because viewers like myself wanted to see the lead actress Jennifer Garner kick and fight her way out of the various tough situations she encountered. Well, AutoCAD going as far back as Release 11 in 1990 had shipped with a free sample lisp file called Alias.lsp (see Figure 6).
Of course the meaning of this alias lisp file is a little bit different than the television series. AutoCAD’s alias is referring to the shortcut names found in the file Acad.pgp. Like lisp files, this pgp file (which stands for Program Parameter) is a text file that can be opened with a text editor for editing. The pgp file is divided into two sections. One section has to do with declaring commands to invoke externally in the operating system. The other section has to do with declaring aliases or shortcuts to invoke AutoCAD commands that are executed within the program (see Figure 7).
With the current AutoCAD version now running on Microsoft Windows Operating System, it’s easy to just launch AutoCAD and at the same time open up Notepad to edit the Acad.pgp text file. Well, back in 1990 when AutoCAD ran on DOS a user can only launch a single program at a time. There wasn’t an easy way while AutoCAD is running to launch another text editing program to know what aliases are programmed into the Acad.pgp file. In fact, back then DOS did not come with a built-in text editing program until 1994.
So here comes Alias.lsp to the rescue. At AutoCAD’s command prompt, the following command sequence loads the file: (load “Alias”)
Entering ALIAS at the command prompt executes the lisp code. Alias automatically locates the Acad.pgp file, reads the contents and displays on AutoCAD’s Text Screen listing in two columns the current aliases or shortcuts that would launch the external and AutoCAD commands (see Figure 8).
Obviously, the drawback of this initial free Alias.lsp sample code only allows the user to see the contents but does not offer an option to edit the Acad.pgp file. Eventually, Autodesk further developed Alias by converting it into an external executable (exe) file that can be launched from outside of AutoCAD starting with Release 14 in February of 1997. Now Alias.exe is part of the Express Tools package which contains add-on bonus files included for again free with AutoCAD for all subscription users. In addition to listing the aliases, users can use the upgraded Alias program to modify the shortcut commands (see Figure 9).
My first job was at an Architectural firm in 1988 where each station had AutoCAD Release 9 installed. Though with that release thickness can be given to objects and a two-dimensional view can be easily switched to a three-dimensional axonometric view, there was still no option to draw on the third dimension. AutoCAD was only known for doing two-dimensional drafting. Some of us even called the program “Two and a half D”. But when AutoCAD Release 10 came out in October of 1988 all of this changed. AutoCAD introduced the User Coordinate System (UCS). The UCS provided the ability to position the two-dimensional drafting plane (X and Y axis) onto the third-dimensional plane (Z axis).
An icon was used to represent this concept. This icon can either be left on or turned off. Though this may be visibly seen on the AutoCAD graphic screen, it will not show up on printed jobs (see Figure 10).
Well, this was an exceptional addition transitioning AutoCAD finally into a three-dimensional design application. But for some reason AutoCAD left out of the core product a very important command. It was missing the command to manipulate an object on all three axes (X, Y and Z).
To make up for this missing piece of the three-dimensional puzzle, a version later with AutoCAD Release 11 in October of 1990, Autodesk included the free sample AxRot.lsp (see Figure 11).
AxRot stands for Axis Rotation of selected objects. When loaded using (load “AxRot”) the program prompts for object(s) to be rotated (this can include two-dimensional and three-dimensional). Then an X, Y or Z axis is entered and finally a rotation angle along with a base point is needed to complete the command.
This free sample lisp file was dropped another version later with AutoCAD Release 12 in June of 1992 when the Rotate3D command was built into the core program. Notice how similar the prompts are when Rotate3D is executed compared to AxRot.lsp. It’s pretty clear that Autodesk developed the Rotate3D command based on the free sample lisp file (see Figure 12).
AutoCAD version 2.0 in October of 1984 was when Attributes were first introduced. This gave users the ability to implement Block Inserts that contain Text objects that are editable called Attributes. This was absolutely necessary to make it possible for objects like Section Block symbols to appear with different editable text callouts. But, with this added feature AutoCAD forgot to include with the core product the ability to easily modify or add Attributes to existing Block Inserts.
Finally, four years and five releases later, AutoCAD Release 10 in October of 1988 included the powerful and free sample lisp file AttRedef.lsp (see Figure 13).
After loading the code using (load “AttRedef”), the command prompt lists two methods for launching the added function:
- AT = shorter method for the keyboard challenged
- ATTREDEF = longer method for the exceptionally skilled typist
Now bear in mind that back in the distant pass there was no BEdit (Block Editor) command which was not introduced till AutoCAD 2006 in March of 2005. So, to manually redefine a Block Insert with Attributes, the first thing to do is to Insert the Block exploded at a scale of 1. Then any of the original Attribute Definition(s) can be modified such as the Prompt and the Default Value. I would leave the Tag alone otherwise the Block Attribute value with the original Tag in all the already inserted Blocks would be lost. At this point, new Attribute Definitions can also be added (see Figure 14).
Now running the added AttRedef command, the code prompts for an existing Block name to redefine followed by a selection of geometric as well as Attribute Definition objects. These should be selected in the exact same sequence as the original. Finally, the command concludes with requesting for the Insertion base point.
AttRedef then automatically searches the entire drawing database gathering all Block Inserts matching the given name and replacing each and every instance with changes made preserving the Attribute values already entered and adding any new Attribute Definitions. This free sample lisp file is so powerful that every release of AutoCAD from 1988 till the present 2023 version still includes it as part of the package. There is no single built-in core command that can perform this same function.
As I mentioned earlier, BEdit can partially fulfill the redefinition of the Block Insert with Attributes. But it still has to rely on a second AutoCAD built-in command called Battman. No, I’m not referring to the DC comic super hero. AutoCAD Release 2002 in June of 2001 introduced this cape crusader of a command that stands for Block Attribute Manager (see Figure 15).
Battman offers the feature to select an existing Block Insert to modify its Attributes. But since Battman is missing the Add a new Attribute Definition function, it still has to rely on the BEdit command to perform this feat. On the other hand, changes made using BEdit does not get applied to all existing Block Inserts. So, in turn, it relies on using Battman’s Sync function to accomplish this. So that running AttRedef.lsp as demonstrated accomplishes everything in one fell swoop.
Hopefully, I’ve got your attention on the many free sample lisp files available now and loaded with the current version of the AutoCAD program. All of these freebies once again remind me of the many free sample food stands at Costco. I remember there was one time I decided instead of going out to buy lunch I’ll just go to Costco and get my lunch from sampling each and every food stand. So, it’s time to go and crack open the AutoCAD folder and feast on the many free gems hidden within.