Programming languages in AutoCAD
Print This Post
![]() |
Author | Erhan Toker |
| Profession | Architect M.Sc. | |
| Autodesk Authorized Consultant | ||
| Software Specialist | ||
As Taliasoft team, we have been developing applications that work integrated wtih AutoCAD for 16 years. Since the foundation of our company, we created applications for some of the biggest companies in Turkey, like ABB, AEG, Mercedes Benz Türk, Eczacıbaşı Bath Kitchen Ltd., Mood Ltd. We published many publications in various magazines regarding AutoCAD™ applications. And today, we are sharing our knowledge with you through this platform. And from time to time, we are presenting some small applications to you in this web page. We call some of the applications as programs that are AutoLISP, or .NET, or ObjectARX based applications. Even now, I can hear you saying ‘I wonder which one of the programming languages is more suitable for me?‘. In this article, I will try to explain and clarify more details about this subject.
Perhaps, one of the best features of AutoCAD that is the reason why it is selected by many users is that it is a customizable software program. Just like the difference between MAC and PC, even though there are better drawing programs, due to the fact that it is customizable, AutoCAD has been one of the most favourite programs of people who are working in CAD works. Because, nearly all of the user interface of AutoCAD, including its menus, status bar, command line, looking, inside outside…, can be customized. In this article, we will only deal with the programming languages which are used for making parametric drawings. First of all let’s see the summary list:

Table 1 - AutoCAD programming and macro languages
Now, let’s briefly go over each of the programming languages:
SCRIPT:
It creates text files that has SCR extension. It is used to execute simple AutoCAD (TM) commands one after another. It is generally used for taking repeatedly print outs, slide shows etc. However, even if it is still applicable in today’s versions of AutoCAD, SCR files are replaced by modern commands.
DIESEL:
When it is first released, its aim was to give several information regarding coordinates and angles through status bar. On the other hand, it is developed more and it can also be used to create menu macros. It has limited areas of usage, however it can be used for very practical purposes. Let’s have a look at the example together:
Command: modemacro
New value for MODEMACRO, or . for none <”">: $(getvar,clayer)
If you change the value of MODEMACRO variable with a DIESEL expression, then you can see the result of this function through the status bar. Layer name that is used in the example is being written on the status line.
AutoLISP:
Previously, we used to create LSP files by using any text editor and use these files as AutoLISP programs. However, since AutoCAD™ 2000, we are using Visual LISP program. By using this program, we can one or more LISP files under one project and can be compiled so that they cannot be read. Compiled LISP file includes all of the LISP files and it takes FAS extension. AutoLISP is a programming language which is very easy to learn. It has a very high tolerance with respect to trial and error. Experienced programmers can make very advanced operations by using AutoLISP.
Advantages : Easy to learn, it does not require any other additional programming tools when Visual LISP that exists in AutoCAD is used. It has a very high tolerance with respect to trial and error. Intermediate level complex jobs can be made with LISP in a parametric manner.
Disadvantages : User interface is quite had to use. You have to learn the programming language called DCL. It is not suitable for doing jobs that require speed and performance. It cannot communicate with databases (Except special commands).
ADS ( AutoCAD Development System ):
First time AutoCAD™ meets a structural programming language that can be compiled like C, was with ADS. However, lifetime of this language was not so long. Right after it, ObjectARX came and ADS was no longer popular. You need to use compiler programs like Watcom C or Metaware C. However, due to the fact that these compilers did not have IDE, you used to create the C files in an external text editor. Extension of the files were ADS or EXE.
Advantages: Compiled code was used to run faster and it was more secure. It was nearly possible to access all of the features that exist in AutoCAD (TM). Even it was very difficult, it was also possible to connect to databases. Operation system file operations was much faster and easier.
Disadvantages : It is very hard to learn C. Compilers that were used was a total headache. User interface was possible again by using DCL. It was very hard to complete a project unless you create your own library.
Object ARX ( AutoCAD Runtime Extensions ):
AutoCAD™ met Visual C++ ( Visual Studio 6.0 ( VS6 ) ) in R13 version. It was a revolutionary new feature to create your own AutoCAD™ entities by using C++. In addition, these new entities that you create was able to be edited by using the standard commands of AutoCAD like MOVE, ERASE, COPY as if it is an original AutoCAD entity. Of course it is quite difficult to make this definition. On the other hand, due to the fact that we were using VS6, it was now available to access MFC libraries. This meant that we were now able to use Windows (TM) windows and controls as our user interface, or directly connect to databases, network communication, internet access etc… File extensions can be ARX or DBX. These files are originally DLL files.
Advantages : It can create secure files that are very fast during execution. It is very easy to create database connections and user interfaces. It works in the same level as the internal commands of AutoCAD.
Disadvantages: It is very hard to learn. You can make the projects much faster by using your own libraries
DCL ( Dialog Control Language ):
It is possible to create user interfaces while programming with AutoLISP and ADS by this programming language. Main principle can be described as giving a key a label or a property to each of dialog controls. By using this key, you can directly access to the dialog control. It is still in use. File extension is DCL. You can examine the files under AutoCAD (TM) and have an idea about it.
.NET :
By using Visual Studio 2002 or 2005 ( VS2005 ), you can create C#, VB.NET DLL projects. MANAGED EXTENSION DLL which is prepared by AutoCAD as ‘ObjectARX wrapper are assigned to the project as references. Extension of the file that was created is DLL and it is loaded into AutoCAD by using NETLOAD command.
Advantages: It is easy to learn. It is quite simple to define a user interface. It is very easy o connect to databases. You can very easily use the code that you have written in your other projects.
Disadvantages: This system is very open to reverse engineering, which means that your DLL files can easily be interpreted. Microsoft Co. Should work a little bit more about this subject. It works quite slower when compared to Object ARX. You cannot define your own custom entity. Due to the fact that the created application works in APPLICATION DOMAIN, you cannot remove it from system memory before shutting down AutoCAD. Because of this it creates a big headache during software development and debugging.
VBA ( Visual Basic for Applications ) :
This is a system that AutoDESK used to obtain Windows™ compatible certificate. You can create simple VB projects similar to the way that you can create VB macros in EXCEL. Our author Serkan ÖZANT is creating channel drawings programs by suing this system.
Advantages: It is very easy to learn. It is very easy to create user interfaces. It is very easy to connect to databases.
Disadvantages: Those who use VBA knows very well that it is very hard to access DLLs and may create different problems in different computers. In addition, as AutoDESK created this system unwillingly, it is not very helpful for the user. It works relatively slowly. It is expected anytime that it may break something in AutoCAD screen.
Technorati Tags: AutoCAD, C++, AutoLISP, Visual LISP, VBA for AutoCAD
Read in other languages: TR
Similar Posts
Rate this article:


August 20th, 2007 10:19
Nice article !
“Disadvantages : User interface is quite had to use. You have to learn the programming language called DCL”
It’s no longer true !
Please see OpenDCL: http://www.opendcl.com
Aymen ELLOUZE
Architecture Student & Software developer
Tunisia
August 22nd, 2007 21:31
Is it possible to pass values for processing between different languages, such as a .NET routine running a child LISP process with values passed to it and returned back to the main .NET routine?
August 23rd, 2007 11:02
Yes it is possible to communicate between Lisp and .Net.
With AutoCAD 2007 and Higher you c
August 23rd, 2007 11:05
… can define lisp callable functions with can recieve arguments and return results (resultbuffer like in ObjectARX), You can also get or set the value of a lisp variable by using dll import … etc
Aymen ELLOUZE
Architecture Student & Software developer
Tunisia
September 18th, 2007 18:00
i work for a geomembrane company that designs very panels for ponds/ land fills etc. and some off our drawings ar irregular in shape so we can make step panels to fit the drawing cna u help me to make something to outline the drawing and clculate the step panels
December 4th, 2007 23:27
[quote]
i work for a geomembrane company that designs very panels for ponds/ land fills etc. and some off our drawings ar irregular in shape so we can make step panels to fit the drawing cna u help me to make something to outline the drawing and clculate the step panels
[/quote]
…*blink*…
yeah, sure, lets just have others do our work for us….
April 3rd, 2008 12:50
Very interesting article.
I try to develop a client-server application for our engeneers. A main idea is to have common model space on server and to work with it by means of client. Is it possible to use AutoCAD directly on client side? What AutoCAD programming technology suits this task? Thank You!
July 15th, 2008 21:39
Some boddy can help me?: I need some code for Object ARX application (AUTO CAD)..