Programming for CAD Managers, Part 114 Apr, 2010 By: Robert Green
By creating your own customized solutions, you can improve your users' jobs and help safeguard your own.
During these past two years of recession, I've seen a lot of CAD managers lose their jobs. I've noticed, however, that those who can program their own customized solutions and really make their offices hum with productivity are more likely to dodge that bullet.
The conclusion is obvious: The more you know about programming, the more valuable you are as a CAD manager, and the more recession-proof your career will be. Therefore, I'm kicking off a multipart series of the CAD Manager's Newsletter to acquaint you with your programming options and point you toward resources that can help you become a better programmer, even if you're just getting started.
In this first installment, I'll describe some common programming technologies and help you evaluate your current experience level. Here goes.
Why Bother with Programming?
Beyond the career benefits I outlined above, programming offers the CAD manager several opportunities that would not be available otherwise, including:
Automating redundant tasks. If your users have to perform complex procedures over and over again, chances are that the processes could be automated to reduce clicks, picks, and errors. After all, why perform the same manual task repeatedly when a program can offer great time savings?
Reducing training requirements. Rather than training users on the manual execution of a process, why not simply automate the process and eliminate the training burden? Using programming to automate tasks saves production time and training time.
Becoming less reliant on others. If you can program your own solutions, you'll no longer have to wait for others to do it for you. As a result, you'll be able to react quickly to changing project requirements and keep your company on the leading edge of efficiency.
Controlling your destiny. If you can program your CAD tools to automate time-intensive tasks, you'll create your own optimized CAD environment. You'll never again be held hostage to what CAD software vendors supply, because you'll create your own features to meet your own unique needs.
Where Do I Start?
Now that you're ready to get started, you'll need to perform some self-assessment to determine what you know and don't know. To facilitate this process, I've provided a summary description of some common programming technologies, along with some diagnostic quiz questions. I encourage you to write down any questions that arise along the way.
Some may not view the customization of menus, ribbons, and toolbars as programming, but almost all the CAD programmers I know started their programming journey performing just this type of work. The extent to which you can customize varies from tool to tool, but it generally allows for the personalization of the interface to suit the users.
By arranging commands into custom toolbars and optimizing the layout of toolbars or ribbon elements, you can give your users exactly the tools they need without the clutter of anything extra. Some CAD tools, like AutoCAD-based programs, allow you to create lightweight programs called "macros" that can automate command sequences into a single toolbar click to create smart user commands.
Quiz questions: Have you ever performed any customization like that I've described above? Do you understand the basic customization features your CAD programs support?
Interpreting results: If you answered "No" to either question above, then this is the place you want to begin your programming quest. By learning the customization interface for your programs, you'll build a much better foundation for the more advanced programming you'll do later.
AutoLISP is an older language that predates Visual Basic, but is still in widespread use with a huge volume of shareware and freeware code available that you can modify for your own use. AutoLISP is specific to Autodesk products that save their files to a DWG format, such as AutoCAD and its Architectural, Mechanical, Electrical, and P&ID extensions, or Civil 3D.
AutoLISP will not work with Autodesk's Revit or Inventor tools, or with any non-Autodesk CAD products. If you do utilize the AutoCAD family of products, however, AutoLISP offers some real advantages:
- No external compilers or development platform software (like Microsoft's VisualStudio) are required, which saves you money.
- AutoLISP is easier for experienced CAD users to learn because the low-level syntax relies heavily on how AutoCAD's Command line operates, thus getting you up to speed faster.
- AutoLISP is a great way to control large AutoCAD-based installations because the programs you write can be deployed via a network server, then loaded in automatically as AutoCAD starts up — thus standardizing the users' operating environment.
And before anyone asks, "Will AutoLISP become obsolete?" I can only say that AutoLISP is so well established, and is in such widespread use, that there would be a revolt if Autodesk were to stop supporting it.
Quiz questions: Do you manage AutoCAD-based products? Do you have a basic understanding of AutoCAD customization? Do you have a good understanding of AutoCAD's command set? Do you already know Visual Basic?
Interpreting results: If you answered "Yes" to all the questions except the last one, then you should begin your programming quest with AutoLISP. Most CAD managers with AutoCAD installations can learn AutoLISP much more quickly than Visual Basic anyway, making this the logical place to start.
Visual Basic for Applications (VBA) and .NET
These are Microsoft's older (VBA) and newer (.NET) development environments for custom programming. They are the most powerful, widely supported environments to work with — and the most challenging to learn.
Most CAD applications have some sort of application programming interface (API) that allows them to interact with Visual Basic programs. The challenge is to get the documentation for your application so you know what you can do. A disadvantage, as compared to basic customization or AutoLISP, is that Microsoft's development environment software — Visual Studio — costs several hundred dollars to purchase and can be cumbersome to learn. Also, you should be aware that AutoCAD is phasing out support for VBA in favor of .NET, and AutoCAD 2010 and 2011 no longer support VBA applications without a downloadable module.
Quiz questions: Do you use non–AutoCAD-based products? Do you already have a basic understanding of how to customize your CAD tools?
Interpreting results: If you answered Yes to these questions, you'll need to begin your programming quest with VBA. If you've never used VBA-based tools, you'll have to climb a steep learning curve — but it's the only way to get the productivity of programming based on the tools you manage.
Now that you've got an idea of what you know and where to begin your programming quest, it is simply a matter of making time to get started and identifying resources you can use to begin learning. In the next issue of the CAD Manager's Newsletter, I'll pass along resource links and advice for sample projects you can use to build your programming skills, no matter what your skill level is. Until then.
Autodesk Technical Evangelist Lynn Allen guides you through a different AutoCAD feature in every edition of her popular "Circles and Lines" tutorial series. For even more AutoCAD how-to, check out Lynn's quick tips in the Cadalyst Video Gallery. Subscribe to Cadalyst's free Tips & Tools Weekly e-newsletter and we'll notify you every time a new video tip is published. All exclusively from Cadalyst!