• Embed Doc
  • Readcast
  • Collections
  • 2
    CommentGo Back
Download
 
Bonus Chapter 6
Using VBA to CreateAutoCAD Applications
 
I
n the previous chapter,you learned the basic syntax ofVBA,and you’ve already been introduced to the AutoCAD objectmodel (see Bonus Chapter 4 on this CD for a review). Now it’s timeto put these pieces together with some additional concepts to createan actual AutoCAD application.In this chapter,you’ll learn aboutUserForms,which provide a set ofuser interface tools for applica-tions written in VBA.You’ll see how to call a UserForm from theAutoCAD interface,how to have the UserForm do useful work,andhow to make your AutoCAD VBA code resident when the user firststarts AutoCAD.Along the way you’ll also explore the VBA editor abit further.
Using UserForms
Adding and Manipulating Controls
Types ofControls
Naming Controls
UserForm Events
Working with Forms in AutoCAD
What’s Going On? Debugging Support
IfYou Want to Experiment…
 
Shortcuts
To Create a New UserForm
Select Insert
UserForm from the VBE menu.
To Add a Control to a UserForm
Select the control in the Controls toolbox,then click the mouse on the UserForm.
To Set Properties of Controls
Type new values for the properties into the Properties Window.
To Display Static Text and Pictures on a UserForm
Use a Label or Image control.
To Display Editable Text on a UserForm
Use a TextBox control.
To Allow Selection from a List of Items on a UserForm
Use a ListBox or ComboBox control.
To Choose between Two Values on a UserForm
Use a CheckBox,OptionButton,or ToggleButton control.
To Start Code from a UserForm
Use a CommandButton control.
To Run Code in Response to User Actions
Write event procedures in the UserForm’s module.
To See the List of Events,Properties,or Methods for a Control 
Use F2 to open the Object Browser.
USING VBA TO CREATE AUTOCAD APPLICATIONS
3
 T
HISCHAPTERORIGINALLYAPPEAREDIN
M
ASTERING
A
UTO
CAD 2004
AND
A
UTO
CAD LT 2004
ANDHASBEENUPDATEDFOR
A
UTO
CAD 2005
AND
A
UTO
CAD LT 2005.
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
09 / 22 / 2010This doucment made it onto the Rising List!

Hi, How can I take a PDF version of this book please? It would be most useful to have on my laptop as a work away most of the time. Thanks Craig

You must be to leave a comment.
Submit
Characters: ...