VB CAD Tips

www.vbcad.com

Where am I? MDT? MAP? Vanilla Acad?
 
Good question.  When you are developing a VBA program to take advantage of one of the vertical markets (Mechanical, GIS, AEC), it makes sense to make sure you know which environment you are in.  Fortunately, we have a way to look at the ARX applications that are currently loaded.

Sub WhereAmI()
    Dim ARXApps as Variant
    Dim I as Long
    ARXApps = ThisDrawing.Application.ListARX
    For I = LBound(ARXApps) to UBound(ARXApps)
        MsgBox ARXApps(I)
    Next I
End Sub

This macro displays the ARX file name of each application loaded.   So, how do you know where you are?  You can look for specific ARX file names.   For example, the file 'acadmap.arx' will show up if you are using AutoCAD Map.   'acme.arx' will show up if you are running Mechanical Desktop.  Other add-ons will also be detectable by using this same method.

Good luck and happy programming!

Back to Tips ©2000 by VB CAD  All rights reserved.         www.vbcad.com