menu groups with vb.net (2003)

Discussion in 'AutoCAD' started by Mark Dubbelaar, Mar 11, 2005.

  1. hi

    i have this code that worked in vb6, and i've adjusted it to what i thought
    should work in vb.net, but it comes up with an error
    'AcadMenuGroups' is a type in 'Interop' and cannot be used as an expression.

    here is the code, can anyone point me in the right direction...
    Public Function GroupExists(ByVal sGroupName As String) As Boolean

    Dim mgMenuGroup As Autodesk.AutoCAD.Interop.AcadMenuGroup

    For Each mgMenuGroup In Autodesk.AutoCAD.Interop.AcadMenuGroups ' *****
    error on this line

    If mgMenuGroup.Name = sGroupName Then

    GroupExists = True

    Exit Function

    End If

    Next mgMenuGroup

    GroupExists = False

    End Function



    thanks in advance

    cheers

    mark
     
    Mark Dubbelaar, Mar 11, 2005
    #1
  2. That's a data type, not an object refrence. Try using the MenuGroups
    property of an AcadApplication object.
     
    Frank Oquendo, Mar 11, 2005
    #2
  3. thanks... that got it


     
    Mark Dubbelaar, Mar 11, 2005
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.