AutoCAD VBA Programming: Tools and Techniques

While VBA has many built-in functions for manipulating strings and other data types, it's still up to the programmer to create support functions for those situations that the VBA language does not support. A VBA programmer must develop his or her own toolbox routines that are best suited to the application being developed. Using the basic functions supplied in VBA, the programmer creates new utilities to speed up the process of creating reports on screen or in a file, stripping information out of a string for other uses, dealing with directories and paths, and many other situations. This chapter covers several of the routines necessary for working in the AutoCAD environment. Many of the routines in this chapter are VBA versions of AutoLISP toolbox routines created for The AutoLISP Programmer's Toolbox (MIS Press). A special thanks to the management of MIS press is in order for granting permission to use some of the same material for this chapter.
The test functions that are supplied with this chapter on the CD show how to use the functions. We have placed a stop breakpoint in each test function so you can use the step next debug feature to walk through the toolbox functions to see how they work. Many programmers won't care: it's enough to know that you pass in some data and the function passes out what you want and this chapter is structured around that principle. We have documented each function as to what the syntax of the function call...