Jump to content

Recommended Posts

Posted

Hi buddies:love:,

as some of you know, to find out whether a menugroup exists in the current work space or not, we can use (menugroup "mygroup"), but I am not sure it is possible to get the name of all menugroups within defined work space:unsure:. Any idea:idea::?:

Thanks in advance:heart::):!:

Mehrdad

Posted

Perhaps this will point you in the right direction:

 

(vlax-for mg (vla-get-menugroups (vlax-get-acad-object))
 (setq mgs (cons (vla-get-name mg) mgs))
)

 

Regards,

 

Lee

  • 1 year later...
Posted

Hi y'all...been writing some basic LISP and beginning to write some VB for small projects. However, I now have an issue that I can't seem to hurdle.

 

I have to have the partial loads in my enterprise cuix because there are two profiles that we are swapping back and forth between, CADWorx PID and Plant. The problem is, some users open CADWorx from a foreign shortcut and do not use the switch'ed shortcut on their desktop and CADWorx "forces" an .arx load into the CUSTOM.cuix. Then I receive the dual error because they are loaded in both main and enterprise cuix.

 

I need to find out how to see if the CUSTOM.cuix has any partials by the name of ... and then unload them and only them. When I run my LISP, it seems to find the menugroups and unload from either or, regardless.

 

Please help! :cry:

 

cuiunload.LSP

Posted (edited)

Use this function

(defun MT:Get:Type:MenuGroup (%menugroup% / *ret*)
;; Mehrdad Ahankhah (Mehre Taban Co.)
(cond
 ((or
   (vl-catch-all-error-p
    (setq *ret*
     (vl-catch-all-apply
      'vla-item
      (list (vla-get-MenuGroups (vlax-get-acad-object)) %menugroup%)
     )
    )
   )
   (vl-catch-all-error-p
    (setq *ret* (vl-catch-all-apply 'vla-get-Type (list *ret*)))
   )
  )
  'NoSuchMenu
 )
 ((= 0 *ret*) 'MainMenu)
 ((= 1 *ret*) 'PartialMenu)
)
)

Some examples:

 

(MT:Get:Type:MenuGroup "nosuch") ; -> NOSUCHMENU

(MT:Get:Type:MenuGroup "acad") ; -> MAINMENU

(MT:Get:Type:MenuGroup "custom") ; -> PARTIALMENU

(MT:Get:Type:MenuGroup "express") ; -> PARTIALMENU

Edited by Ahankhah
Posted

Another variation perhaps:

 

(defun _menugrouptype ( group )
   (if (menugroup group)
       (vla-get-type (vla-item (vla-get-menugroups (vlax-get-acad-object)) group))
   )
)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...