Академический Документы
Профессиональный Документы
Культура Документы
Home | Products - Store - Support - Autodesk Subscription | About Autodesk - Contact Us | Search
United States
Product Information
How to
Buy
Autodesk Subscription
Consulting
Training
Custom Training
Authorized Training Centers
Courseware
How-to Articles
- Tutorials and How-to
- Expert Q&A
- Customization
- CAD Management
- Design Collaboration &
Internet
- Hardware & Systems
- Industry Trends
- Routines, Tools & Add-ons
- Authors
Tips
Support
Data & Downloads
found in other Windows applications—specifically, Microsoft Excel.
Through Visual Basic programming within AutoCAD, you can launch
Excel and bring the full power of a spreadsheet application into an
AutoCAD drawing session. The information in this series will
VBA: Integrating with demonstrate how to generate, organize, query, and extract linework
Microsoft Excel - Part 1 visibly or behind the scenes during an AutoCAD session without
By dave-espinosa aguilar spending a dime on additional compilers or documentation. If you
have AutoCAD and Microsoft Excel already loaded on your
This article is the first in a series on workstation, this technology is ready and waiting for you to take
integrating the programming advantage of it.
p
o To enter the world of Visual Basic programming and add Excel
w functionality to AutoCAD software, you have to be willing to spend
e the time it takes to master this object-oriented programming tool.
r Even if you've programmed in AutoLISP® before, Visual Basic is
not as forgiving or as accommodating, and the rules that must be
o obeyed for everything to work right when you run your own VB
f applications are very strict. This isn't to say that an AutoLISP
programmer can't conquer the world of Visual Basic; it just takes
A more dedication and effort.
u
t So... as with any serious investment of your time, it pays to step
o back and examine what getting up to speed on Visual Basic (and
C the integration of AutoCAD VBA and Microsoft Excel) brings to your
A table in the first place. The more you learn about the software you
D already own, the more powerful it gets and the more impact it
® stands to have on your productivity. If the nature of your drawings
and designs lends itself to spreadsheet functionality, then consider
V setting aside notions of cranking out code, and go Zen with me for a
B bit as we consider some potentially profound questions... beginning
A with "Why should any AutoCAD user care that integration of
AutoCAD and Microsoft Excel is even possible?"
w
Reason #1: Automated Fully Customizable Part Counts
i
Have you ever counted entities in a drawing manually? By that I
t
mean to ask have you ever (with your finger or pencil) tallied every
h
parking lot space or every chair or every toilet in a bathroom or
window on an exterior building wall or every HVAC fixture
t
throughout a series of roof plans? Have you every counted
h
sprinklers or landscaping features by plant type, bolts or screws for
e
an assembly, or datapoints for a given site plan? Imagine pressing
a menu button and being done with the process!
f
u Reason #2: Queries
n Maybe you use blocks with attributes. Have you ever wished you
c could count blocks (or maybe even select them) based on the
t values in
i those attributes? Maybe you use Extended Entity Data, which
o attaches gobs of unique information to individual entities.
n Wouldn't it be slick if there were an easy way to take the sum or
a average of that information within seconds?
l
i There are some ingenious tricks and techniques out there like
t using the old SSX.LSP routine, the internal FILTER command
y and various
Figure 2: When you bring Excel grids into your drawings, you have complete
control over text formatting, column width, cell border thickness, and even
background patterning.