Introduction

Our book is called "AutoCAD-based CAD. How to do it". All the words from the title are key for understanding what is covered. CAD system is Computer Aided Design system. So it is a system and not several programs and methods that will be discussed. And this system is itself based on AutoCAD system by Autodesk (USA). AutoCAD is one of the popular systems in the world and is the most popular in Russia. It is a powerful graphical kernel that is used by many application systems created by Autodesk itself (Mechanical Desktop, Land Development Desktop and so on) as well as by programs and systems developed by Autodesk partners and independent producers. Further for clarification we shall call "pure" AutoCAD BASE system.

AutoCAD in the volume of base supply provides execution of drawing (and not only drawing) jobs for any field using only basic tools. With the help of standard entities (lines, polylines, circles, texts etc.) one can "draw" almost all that is necessary. But the end user (machine designer, builder, water-supplying designer) needs not the entities but real objects (buildings, hardware, pipings, city plans and many similar things). It should be made quickly and with high quality and with the standards that are valid in the country or in the branch.

All the end users in many countries need Autodesk could not include into the BASE system. But it is unnecessary because we would get such a monster where many few used means would present but anything would lack. Autodesk went in a right direction and gave the BASE system excellent developer's tools. Using these tools one can create programs for building drawing as well as for ship designing and for "bolts and nuts".

And we will try to explain "how to do it".

Book Features

Many books are devoted to using and customizing AutoCAD as well as to LISP programming that is the main or the oldest developer's tool inside AutoCAD are already published in the USSR and Russia. These books as a rule inform about functions, commands and system variables. Usually it is enough for the reader to begin and to be a success in creating his own programs.

But after overcoming the first language difficulties and after knowing the basic methods user meets new questions of the next level. The developer gradually begins to understand that his dozens and hundreds of programs should be somehow regulated. There arises a wish to distribute his applications and get money for them. At this stage the author comprehends the difference between the good (or very good) program and the program product. And most of all he opens for himself that some things should be done otherwise and some things nead to be rewritten. Definite programs work only in author's presence, at his computer. And the dreams of sales and earnings are to be thrown out. In this book we shall try, using our own experience, mistakes and discoveries, to reveal the techniques and technology of developing complex CAD system for creating various drawing documents. It will be shown from the idea up to issuing the system. And it will be done at the sample "our CAD". The CAD system will be hypothetical but will have a distribution package with an installation program that could be found at authors sites.

Most of the questions discussed in the book are not invented at an empty place. They arose and were solved during developing real application systems. For some years we have taken part in the work of several forums on the Internet. And the analysis of thousands of questions discussed there helped to include some actual and interesting themes.

The book is not a reference book, textbook or manual for programming languages studying. Neither lists of commands and system variables nor list of functions, procedures or methods are included. You can find them in another books (e.g. in the books of Nikolai Poleshchuk). You can find them in the AutoCAD help system (alas, this part of information is localized the last). We publish reference data only for officially undocumented functions, methods and variables. We tried to reveal the themes that were not considered earlier or were incompletely described in the technical documentation.

Whom the Book Is Written for

This book is to be positioned as a book for developers of the application systems based on AutoCAD. Please notice: not for the programmers (but they may read the book too).

We must say that development of AutoCAD-based application systems is being as a rule made by ordinary engineers and not by "real programmers" (at least in Russia). According to our observations it is caused by the fact that it is simpler for an engineer to study not very difficult AutoCAD development tools (and receive excellent results) than for a professional programmer to do this "dirty" job. Really problems solved "under AutoCAD" usually involve neither complex mathematical methods, nor cunning handling of huge volume of data, nor clever use of operational system resources. But features of interface, acquaintance with subject, profound knowledge of AutoCAD and obligatory love to user are of great importance. All this comes only after a certain experience of design process (both "with paper" and "with computer").

Very often an engineer having written some programs for himself becomes "sick" with an incurable illness named "CAD system". He continues parallel designing/constructing and sometimes becomes a professional developer. One of the aims of this book is to shorten this difficult road.

Perhaps only in Russia such a great amount of people is occupated with "other" deed. Architects create music and teach on TV how to cook, airspace engineers write and read from the scene humour stories and building engineers build information systems that are not connected with building at all (as one of the authors does). Professional programmers not involved into project teams look for doing something "bad" (and manage to do) while a constructor heavily tries to understand how to reach an Interbase server from AutoCAD. Maybe our book will put some programmer to a "true path" and will give new decisions for constructors.

Book Structure

We tried to write the book so that its final target would be reached with minimal moral and material losses for readers. Book is overcrowded with sources which it is better to read not near the soup plate but near the computer. But do not be in a hurry to type the source texts . Maybe you will find them on the attached disk, at Publisher's site or at authors' sites.

We examine a real CAD system in the book and the reader can use this system in his work. This is done not with the help of step-by-step instructions (though some them are present). One cannot create a CAD system "step by step and only ahead". More often it is necessary to make "three steps left, three steps right, one step ahead and two steps back". Relatively it is impossible to write a book with a logical exposition of such steps.

The book consists of the following parts:

q      The part 1 deals with a general conception of a CAD system being created. We shall think over the project principles, understand what system we would develop, what tasks it should solve and what will differ it from the analogous ones.

q      In the part 2 we will discuss what can and should be done without programming (block libraries, hatches, linetypes), that is with AutoCAD customization. Well done libraries used in connection with simple programs allow automation of many routine operations for drawing various images.

q      The part 3 is devoted to building developer's tools for application programming inside AutoCAD. We will analyze some tools in AutoLISP, Visual LISP, VBA, work out some rational ways and write all the necessary library functions for ligtening application programs developing.

q      In the part 4 we will examine the programs for the end user. At first we will make a "programmer's chest" with a set of tools for our own self-interest aims (for making our job easier), then we will write a dozen of simple 2-3 lines common programs. These pure programs will allow to append to AutoCAD menu hundreds of programs for creating thousands of images. And while users are studying all the fallen possibilities we will write a heap of specific programs, for builders, HVAC designers, topographers, general planners, electricains and gas suppliers. We will add to our system elements of document management for improving folders and files handling, we will make a simple but convenient for real time work electronic archive with tracing papers, typical solutions and various documents.

q      The 5th part which is the last one tells how to issue the system converting a mass of program into an application product. Creating help system, preparing installations and (why not?) technology of distribution - everything will be here.

Notifications

Many problems touched in the book have no unique solution (except converting degrees to radians and back). Designing in general and especially designing CAD system is a creative process. There are no ready recipes. We offer trends for thinking and some ways of solving. The readers can (and will) find better solutions in conception as well as in realization. If so the authors will be glad only.

There are many ways of solving the problems involved and some solutions are not unique even among the authors. Then we will distinguish the opinion of every author using "Another Mind" cut-ins. The reader will make his final decision himself.

Though some "X-files" are present in the book you should not think that all our and other secrets will be revealed.

q      Firstly we do not know them all.

q      Secondly we must leave something for ourselves.

q      Thirdly (and the main one) we do not hide that many news we get from the Internet where some curioius materials (e.g. on AutoCAD undocumented possibilities) are accompanied by threatens in which "caves", "rituals", "bad spirits", "blondes" (emphasized females, not males) are mentioned and by subtle hints of "visits on Thursday between midday and two o'clock" and by some fascinations else. Wishing to prevent the readers from "visits" and "rituals" we will refrain from publishing something. Restrict us meanwhile.