Importing Markers into AutoCAD

This example file shows three different ways to import marker data into AutoCAD. The file contains three different macros to import the markers; directly using the collection, indirectly using an array and the collection and finally using lists. A similar procedure could be performed using the Surfaces and SurfaceList objects.

 

The Marker object can be referenced in two ways; either through the collection using the Markers object, or through a list using the MarkerList object. The difference between the two ways is that the list object will retrieve all the specified markers in one call to Maxsurf, where the collection object will make a call for every individual marker.

 

The result is that, for a slightly more complicated program, the execution is much faster when using lists. This example shows three different methods of performing the same task and uses the VBA.Timer object to show the speed of execution of the different methods.

Resources

The file containing these macros is located in C:\Program Files\Maxsurf\ Automation Samples\Maxsurf\Importing Markers.dwg or in the directory that Maxsurf is installed. Opening the file and enabling macros will add a menu item named “Maxsurf” to the menu bar. The items in this menu will run the macros in this drawing. The menu item will be removed on closing the file.

·   Importing Markers using Collections

      Importing Markers in an Array

·   Importing Markers using Lists