AutoCAD 2002 Bible

Скачать в pdf «AutoCAD 2002 Bible»


(ax-make-aLine) J



ct


as a


v


la


-o


bject.


ret


riev


e


th


e


model


spa


ce o


bj


ec


t


get


the


c


ur


re


nt


act


ive


do


cume


nt


get


the


a


ca


d


object


sta


rtin


g


po


in


t


end


ing


po


in


t



and load it. To try it out, type the follow-


Visual LISP responds with the following:


#<VLA-OBJECT IAcadLine 03614934>


This might seem a little cumbersome — as if it might be a lot of work to create a line — but quite honestly, it isn’t. It’s actually quite flexible.


To locate other ActiveX functions that create objects, you need to look in the AutoCAD ActiveX and VBA Reference. In Visual LISP, choose Help, Visual LISP Help Topics. From the Contents tab, double-click ActiveX and VBA Reference, then Methods. You immediately see an alphabetical list with the A’s displayed. Here are all the VBA methods that add drawing objects. To create a Visual LISP function, add VLA- before the method. For example, to add a circle, you would use VLA-AddCircle.


Tip    You immediately know if the function is correct, because it turns from black to


blue as you enter it.

Debugging Code


Because few people can write perfect code at first try, there’s always a need to debug code. Debugging is simply the process of trying to locate and correct mistakes. In this section, you look at some simple examples, using some of the debugging tools Visual LISP has to offer.

Скачать в pdf «AutoCAD 2002 Bible»