There have been LISP routines around for years that accomplish this... you may have better luck posting your question in the "AutoCAD > Visual LISP, AutoLISP and General Customization Issues" discussion forum.
HTH,
Martin Schmid, P.E.
Autodesk Consulting
Martin Schmid
Product Line Manager
Mechanical Detailing and Electrical Design
Architecture, Engineering, and Construction
Autodesk, Inc.