Ahankhah Posted April 15, 2011 Posted April 15, 2011 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 Quote
Lee Mac Posted April 15, 2011 Posted April 15, 2011 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 Quote
Piper for Hire Posted November 26, 2012 Posted November 26, 2012 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! cuiunload.LSP Quote
Ahankhah Posted November 27, 2012 Author Posted November 27, 2012 (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 November 27, 2012 by Ahankhah Quote
Lee Mac Posted November 27, 2012 Posted November 27, 2012 Another variation perhaps: (defun _menugrouptype ( group ) (if (menugroup group) (vla-get-type (vla-item (vla-get-menugroups (vlax-get-acad-object)) group)) ) ) Quote
Recommended Posts
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.