CAD Manager Programming Topics, Part 110 Sep, 2008 By: Robert Green
If you've been thinking about learning programming but aren't sure whether you should, here's what you need to know.
A lot of CAD managers ask me about programming methods and how the ability to program can help or hinder their careers. I'll be devoting the next few newsletters to addressing some of these questions and sharing some programming tips and tricks that you can use to get control of your CAD environment, even if you know very little about programming now. Here goes.
Why Program At All?
So why should you program? Fair question, especially since you're already busy and would have trouble finding the time to do programming in the first place. I do feel strongly, though, that the ability to program is a huge plus for CAD managers, so let me tell you why I think the effort is worth the hassle.
It makes things easier for your users. Programming allows you to make complex processes easy via automation. Fewer keystrokes equal less work for the user equals greater user productivity. I've also found that automation reduces errors, thus making users even more productive.
It makes you more self-sufficient. If you do your own programming you won't be dependent on someone else and you'll be able to react faster to users' needs.
|API — Application Programming Interface. Allows the programmer to link custom programming to the CAD tool. Some programs (like AutoCAD) support multiple APIs (AutoLISP, VBA, Visual Studio), while others support only one.
AutoLISP — A programming language used by Autodesk's AutoCAD product line for customization.
VisuaLISP — An extension to AutoLISP introduced with AutoCAD 2000.
VBA — Visual Basic Automation. Programming language based on Microsoft's Visual Basic environment but runs only inside the CAD tool rather than in an external programming environment. The benefit of VBA is that any user can run VBA programs without purchasing expensive compilers.
VB — Visual Basic. Microsoft programming language that has been used extensively over the past seven years not just for CAD customization. Visual Basic is being replaced by .NET language.
.NET — Pronounced "dot net," Microsoft's newer programming language environment is a direct descendant of Visual Basic. Typically purchased in one of Microsoft's Visual Studio packages, .NET is now the standard programming framework for almost all CAD packages.
What Do You Know?
Now that you're pumped up about programming you need to take concrete action to start or expand your learning curve in the right place. Part of this first task is honestly assessing what you know and don't know. I'll present some diagnostics for you to help figure out where you stand. (If you don't understand the terminology, see the Buzzwords sidebar.)
Menu/Toolbar customizing. Some people may not call this programming, but I like to include it because it is a way that you can transform out-of-the-box CAD tools into a customized user interface that is optimized for your users. The degree of customization varies for each CAD program, and the AutoCAD-based tools have a very high level with their built-in customizable user interface (CUI). Almost all CAD tools allow you to control the toolbar interfaces by adding, subtracting, or combining various command tools onto custom toolbars. Some, including AutoCAD, even allow you to perform lightweight programming via script or macro language to accelerate repetitive tasks.
AutoLISP. This coding is specific to Autodesk products that save their files to a DWG format, for example, AutoCAD or any of the Desktop series products. AutoLISP is an older language that predates Visual Basic but is still in widespread use with a huge volume of shareware/freeware code that you can modify for your own use. AutoLISP offers the advantage of not requiring any external compilers and simple program file editing using NotePad so you don't have to learn anything new other than the language. AutoLISP is so well established that I can never see it becoming obsolete and is easy enough that it is a logical place for novice programmers to learn basic concepts.
Visual Basic Automation (VBA). VBA is a reduced set of Visual Basic tools that allows you to construct programs that run inside your CAD application. VBA is widely supported not only by CAD tools but by Microsoft office applications like Word and Excel, so anything you learn in VBA will help you automate other office applications besides CAD.
Visual Basic (VB) and .NET. These are Microsoft's older (VB) and newer (.NET) development environments for custom programming and are the most powerful environments to work with and the most challenging to learn.
How to Get Started
Well, how was your self-assessment? What should you work on now? Let me offer a few general recommendations.
Menu/Toolbar customizing. If you don't know this, start here. You typically need to know these types of customizing tools to progress in programming anyway, and this technology is the easiest to learn. If you already have a good working knowledge of customizing, continue on.
AutoLISP. If you manage AutoCAD-based products, you should know AutoLISP to some degree. If you're just starting to learn programming, start here. And even if you know another language, like Visual Basic, it still pays to know about AutoLISP. If you don't use AutoCAD based products, then AutoLISP will not apply.
VBA. If you're already comfortable with Visual Basic you'll learn VBA quickly, but if you've never programmed before you may be intimidated starting with VBA. If you want to learn more about this but have no programming background, you'll definitely want to take a training class to get the jump on this topic.
VB and .NET. Very much the same as stated for VBA above, VB and .NET are widely used programming tools that allow access to word processing tools, spreadsheets, and external databases, so if that sort of functionality is something you aspire to, you'll need to learn these tools.
No matter your skill level or years of experience, an occasional training class will jolt you out of old ruts and allow you to look at your programming skills from a new viewpoint. And for beginners, training classes give a jump start into what can be a confusing new world.
The availability of training classes varies greatly according to location, but you can always start by working with your CAD resellers to see what they offer, and community and technical colleges frequently offer programming classes (be they CAD focused or not) that can help as well. To address this training conundrum, I'll be passing along some self-help resources for you in coming issues.
CAD managers who customize and program their own CAD tools have a brighter future than those who don't — it's that simple. And as you delve into programming methods, your thinking will change from a mindset of being limited by your CAD tools to a proactive, "I'll make this work" mindset.
In the coming issues of the CAD Manager's Newsletter I'll be giving you some instruction on getting started with programming and link you to some resources that can help you in your programming quest. Until then.
In her easy-to-follow, friendly style, long-time Cadalyst contributing editor and Autodesk Technical Evangelist Lynn Allen guides you through a new feature or time-saving trick in every episode of her popular AutoCAD video tips. Subscribe to the free Cadalyst Video Picks newsletter and we'll notify you every time a new video tip is published. All exclusively from Cadalyst!