PullDown Menu

MarcelGoulet

Usenet Archive
Joined
Jul 25, 2003
Messages
34
Reaction score
0
Hi,

How I can know, if a certain pulldown menu is displayed are not in a autoCad session using lisp ou vlisp ?

The menu can be loaded, but the popup is not displayed.

For exemple, if I want to know if Express pulldown menu is displayed ? How I can know that ?

Thanks,

Marcel
 
Pulldown Menus

(if (not (menugroup "<Yourpulldown>"))(command "menuload" "c:/Program Files/AutoCAD 2004/Your Menu/Yourmenu.mns"))

MarcelGoulet said:
Hi,
How I can know, if a certain pulldown menu is displayed are not in a
autoCad session using lisp ou vlisp ?
 
(defun rrbI:IsPopupDisplayed (popName / Found)
(vl-Load-Com)
(vlax-Map-Collection
(vla-Get-MenuBar (vlax-Get-Acad-Object))
(function
(lambda (objPopup)
(cond ((= popName (vla-Get-NameNoMnemonic objPopup))
(setq Found T))))))
Found)

_$ (rrbI:IsPopupDisplayed "Express")
T

_$ (rrbI:IsPopupDisplayed "dsfsdfs")
nil
 
You're right. I had that worked out once, I can't remember how I did it anymore.

I'm getting too old....
 
That's why I prefer the NameNoMnemonic property; you don't have to mess with all those ampersands (&).

--
R. Robert Bell, MCSE
www.AcadX.com

"Luis Esquivel" <www.draftteam.com> wrote:
| What Robert posted is the way to go.
|
| here is an alternative:
|
| (vlax-for i (vla-Get-MenuBar (vlax-Get-Acad-Object)) (print (vla-get-name | i))) | "&File" | "&Edit" | "&View" | "&Insert" | "F&ormat" | "&Tools" | "&Draw" | "Dime&nsion" | "&Modify" | "E&xpress" | "&Window" | "D&raftTeam" | "D&raftTeam" | _$ | | and by following the above naming | | (if (not | (vl-catch-all-error-p | (setq | obj (vl-catch-all-apply | 'vla-item | (list (vla-Get-MenuBar (vlax-Get-Acad-Object)) | "&Window"))))) | (vla-get-onmenubar obj)) | | it will return :vlax-true or' :vlax-false | |
 
You know as well as I do <vbg>. I like to match what I see on the pop menu's label, so I didn't force case matching.

--
R. Robert Bell, MCSE
www.AcadX.com

| Very nice Robert! Is string case important? :-)
|
| | > sho' nuff is!
| >
| > --
| > R. Robert Bell, MCSE
| > www.AcadX.com
| >
| >
| > | > | ah yes.... and vla-Get-NameNoMnemonic sure is handy :) | > | | > | > | |
 

Latest threads

Back
Top