|
Volume 10, Number 6 -- 1 June, 1997
AutoCAD R14
What is ActiveX?
By ROBERT CHEEK
With Release 14 now shipping, Autodesk has added yet another new flavour to their open
architecture. Programmers have long had the ability to code in AutoLISP. Release 11 (R10
in OS/2) saw the addition of the AutoCAD Development System (ADS) while R13 provided the
AutoCAD Runtime eXtension (ARx). With the computing world moving towards objects, Autodesk
has renamed ARx as ObjectARx. But in addition to these more traditional programming
environments, R14 has also added an ActiveX interface.
What is ActiveX?
In short, ActiveX is Microsoft's new name for the old Object Linking and Embedding
(OLE). But it is more than just a new name. ActiveX not only cleans up some of the mess
that OLE had become, but also extends it in new directions.
The main purpose of the ActiveX system is to allow an application to expose portions
of its own internal coding to other applications. An application that does this is called
an Automation Server. An application that accesses these servers is called an Automation
Clients. When a client connects to a server, it is able to extend its own functionality
without having to do all the grunt work itself.
Say, for example, that I am writing a word processor just what the world
needs <g>. I would like to be able to save my documents in multiple formats
(Word, WordPerfect, AMI Pro, etc.). Rather than adding all the code in my program to
do this, I can run Word (providing that the user has Word on their system) as an
automation server and have it save the document in any of its supported formats for
me. The user does not even have to be aware that this is what I am doing.
ActiveX Components
This has led to an entirely new branch of computing: the ActiveX component. Such
a component is just a hidden automation server that allows those that use it to access
some kind of additional functionality.
While rapid application development (RAD) tools, like Visual Basic and Delphi, have
altered the way in which developers work, ActiveX promises to take that one step
further. Bloated programs, like Word, will become less and less the norm as
developers begin to build applications out of smaller, more specialized subsets of tools.
Getting back to AutoCAD, ActiveX support opens a whole new realm of possibilities
for AutoCAD developers. It will now be possible to create programs that access
AutoCAD drawings without having to run the full AutoCAD interface. Release 14
includes a couple of samples, specifically BatchPlt (the batch plotting utility) and
EBatchP, the enhanced batch plotter. After you use the programs to create a list of
drawings to plot, both launch AutoCAD to perform the actually plotting.
ActiveX components eliminate the compiler dependency issues that ADS and ARx
handcuff a developer with. Rather than having to utilize only those compilers that
ADS (read: Autodesk) supports, the developer can now utilize any Windows development tool
that supports ActiveX technology. These include Microsoft Visual C++, Borland C++,
Borland C++ Builder, Delphi, Visual Basic, PowerBuilder, Access, Excel, dBase, Paradox,
Visual FoxPro and on and on and on.
Sample ActiveX Coding
The following is a simple Visual Basic example of how to attach to an AutoCAD session
and zoom the current viewport in the current drawing to its extents. To work, it
requires that AutoCAD be running.
Dim AutoCAD as Object
; Connect to the AutoCAD session and zoom the drawing
AutoCAD = CreateObject
("AutoCAD.Application"
AutoCAD.Document.ActiveViewport.ZoomExtents)
Rob Cheeck is the ActiveProgram Director for VAUS and has contributed prolifically
to CADvisory for many years. ¤
Table of Contents
CAD Management:
How To Spot a Real AutoCAD User
By DAN REED
Real AutoCad Users...
... Have been doing AutoCad for 6 or more years.
... Never bother to keep .BAKs.
... Wrote some massive front end-loader or AutoCad that erases .BAK files.
...Can write a menu.
...Don't use the menus that came with AutoCAD, they wrote new ones.
...Run any program from the menu.
...Figured out how it get extended ASCII characters in a menu.
...Can write a hatch pattern
...Can write a linetype.
...Can write a text font.
...Realize that writing a text font is a total waste of time.
...Don't have a mouse, they have a 'Puck.
...Have a puck with 16 buttons, and use them.
...Don't bother with file locking.
...Never call 1-900-RUN-ACAD for support.
...Know AutoCAD so well, they might as well start their own 1-900 number service, and make
some money on the side.
...Have all sorts of little "cut-outs" from the AutoCAD manual pasted on the
fronts of their machines.
...Get real irritated when someone else uses their machine just to "look
around."
...Know AutoLISP.
...Already took out all the worthless statements in the LSP files in AutoCAD.
...Know that by avoiding the "Bonus"
files that come with AutoCAD, they will save up to 4MB of disk space.
Real AutoCAD Users...
...Load up the "Bonus" files, just to see
if anything is new, then erases them.
...Know that the Recover command from the main menu, is busted.
...Have gotten the "Floating Mathcoprocessor Mismatch" error.
...Change the screen colors weekly.
...Have a graphics card that can support two monitors.
...Wonders why Autodesk give you so much worthless stuff with a software upgrade.
...Wonders why Autodesk charges so much for an upgrade, and wonders why AutoCAD gets
pirated.
...Have at least six older copies of AutoCAD.
...Never ask for the newest copy of AutoCAD; they already have it.
...Have a free subscription to CADalyst.
...Could write an article that could go in CADalyst.
...Despise Macs.
...Don't have friends that run CAD on a Mac.
...Are not concerned with loosing a drawing.
...Still panic when INTERNAL:EREAD ERROR 00G comes up on the screen.
...Know that when INTERNAL:EREAD ERROR 00G comes up, nothing can help, except for a
backup.
...Know what the files ACAD.$$1 and SWR0V01.001 are, and how to get rid of them.
...Have all of the .LSP, .DWG, and .SHP files separate subdirectorys.
...Have layer names like: TRASH
1
Q
BLA
TEMP
...Don't have layer names like :FIRSTFLOORDOORS
DIMEMTIONX2
OLDSTUFF
FINALPLOT
...Know UCS.
...Hate UCS.
...NEVER type ZOOM D.
...Wonder why AutoCAD has a dialogue box pop up to save a drawing.
...Wrote a way around the Save dialogue box.
...Wonder why colors 0 and 7 are white.
...Uses VPOINT not DVIEW.
...Use the PURGE command about 60 times in a drawing
...Know that by editing a slide file with a sector/hex editor, you can make all sorts of
nifty phycadelic things happen to your menus.
...Use the spacebar, not [Enter].
...Have either drawn a picture of: Their car,
Their house,
Their dream house,
Or their dream house
with their dream car
parked in the drive..
...Will admit that when they first started AutoCAD that their "fun" drawings,
sucked.
...Can talk on the phone and draw at the same time.
...Drink lots of liquid while drawing.
...Go to the bathroom a lot.
...Get some exercise walking to and from the bathrrom.
...Are not afraid to eat while drawing.
...Can leave the room while plotting.
...Leave their system on 24 hrs a day.
...Don't care that the system is on 24 hrs a day, it's not their machine.
...Don't really like the system they run AutoCad on, they are sure there is a better one.
...Will always complain that AutoCad on their system is too slow.
...Work in the dark.
...Get irritated when someone turns on the light.
...Get REAL irritated when people say - "How can you work in the dark like
this?"
...MUST listen to the radio while working.
...Have their own radio to listen to.
...Are reading this while they shoud be working....
¤
=============================================================================
File Originated From THYRATRON BBS! (609) 582-5410!
80 Megs Online, Supporting The World Of The Sick+Wierd!º
* AutoCad
* SoundBlaster/Adlib
* IBM Tech Support
* Sub Genius Fun!
Table of Contents
|