What menu groups loaded?

Discussion in 'AutoCAD' started by Mark Ingram, May 10, 2004.

  1. Mark Ingram

    Mark Ingram Guest

    With lisp/vlisp, how can I tell what menugroups are already loaded? I want
    to load an additional menu if it's not already loaded.

    Thanks,
    Mark
     
    Mark Ingram, May 10, 2004
    #1
  2. ; retrieve a list of loaded menu groups
    ; return: list of strings or nil
    (defun getMenuGroupNames (/ names)
    (vlax-for menu (vla-get-menugroups (vlax-get-acad-object))
    (setq names (cons (vla-get-name menu) names))
    )
    (reverse names)
    )
     
    Jason Piercey, May 10, 2004
    #2
  3. Mark Ingram

    Jürg Menzi Guest

    Mark

    ;
    ; -- Function VxGetLoadedMenus
    ; Returns a list of all loaded Menufiles and Groups.
    ; Copyright:
    ; ©2000 MENZI ENGINEERING GmbH, Switzerland
    ; Arguments [Typ]:
    ; --- =
    ; Return [Typ]:
    ; > Dotted pair list '(("MenuFile" . "MenuGroup")...)

    • ; Notes:
      ; None
      ;
      (defun VxGetLoadedMenus ( / MnuLst)
      (vlax-for Obj (vla-get-MenuGroups (vlax-get-acad-object))
      (setq MnuLst (cons
      (cons
      (vla-get-MenuFileName Obj)
      (vla-get-Name Obj)
      )
      MnuLst
      )
      )
      (vlax-release-object Obj)
      )
      (reverse MnuLst)
      )

      Cheers
     
    Jürg Menzi, May 10, 2004
    #3
  4. Mark Ingram

    Mark Ingram Guest

    Thank you both,
    Mark
     
    Mark Ingram, May 11, 2004
    #4
  5. Mark Ingram

    dblaha Guest

    This routine seems to cause an Access Violation every once in a while:

    ; error: Exception occurred: 0xC0000005 (Access Violation)
    ; warning: unwind skipped on exception
    ; error: Exception occurred: 0xC0000005 (Access Violation)
    ; error: Exception occurred: 0xC0000005 (Access Violation)

    Does it need a release?
     
    dblaha, Jul 27, 2004
    #5
  6. Mark Ingram

    dblaha Guest

    Never mind. Scrolled down a bit...
     
    dblaha, Jul 27, 2004
    #6
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.