In addition to the information we cover in this the folder C:\Program Files\AutoCAD 2006\
chapter, you should explore the AutoCAD Sample\VBA by default. DonĂt forget about the
Object Model and take a look at the different invaluable tool the Internet can be; it is a great
objects and collections that are in the AutoCAD tool for finding tutorials that demonstrate how
Object Library through the Object Browser in to use VBA for AutoCAD as well as many other
the Visual Basic Editor. AutoCAD also ships host applications.
with a variety of samples that can be found in
Adding a new procedure to a code module
These steps describe how to create a new procedure in a code module:
1. Click in the Code window for the new code module.
A code window should have opened up automatically when the new
code module was added. If not, double-click on basDraw in the Project
Explorer for the project. Clicking in the code window sets the focus to
the code window or at the desired location within the code window.
2. From the Insert menu in the Visual Basic Editor, choose Procedure.
This launches the Add Procedure dialog box (see Figure 4-14).
Figure 4-14:
The Add
Procedure
dialog box.
3. Enter DrawLine in the Name field.
The name entered is what will be used by the Macros dialog box and the
-VBARUN command or will be used to call the subroutine from another
location in the code.
4. Click Sub under the Type section.
Tidak ada komentar:
Posting Komentar