Sorting Layer/Level Names

When developing VBA macros for either AutoCAD or MicroStation it is often necessary to display a list of the layers/levels in the active file in either a ListBox control or ComboBox control. Unfortunately the layer/level names are not sorted in alphabetical order and the VBA UserForm controls do not have their own Sort methods. Using a standard bubble sort routine does a nice job of sorting a string array of layer/level names.

Envision is a leading provider of CAD related solutions to engineers, surveyors, and GIS professionals. We have been providing expert solutions for CAD, Civil and Geospatial applications for both government agencies and AEC firms since 1996.