Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

POP menu position

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
SAPER59
571 Views, 7 Replies

POP menu position

How can I get the position (POPn ) where a menu is, considering the other menues loaded (ACAD, Expres.. etc)

 

For example:

 

File  Edit  View  Insert .  .Express  WIndow  Help  DOBLADO  PCSMEN. .. and I need to know the position of DOBLADO.

 

 

 

 

Thanks in advance

 

7 REPLIES 7
Message 2 of 8
johncavogt
in reply to: SAPER59

Is your goal just to rearrange them all to an office standard order? You don't need to know where they are to do that.

Message 3 of 8
scot-65
in reply to: SAPER59

Misread the thread.


Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.


Message 4 of 8
SAPER59
in reply to: SAPER59

What I need is if it is already loaded, replece it with another, depending it on the action set before, becouse each menu has its own function , and both must no coexist

 

I'm trying to find working with vla-get-menugroups  and vla-get-menus  functions to find if it is possible

Message 5 of 8
markruys2
in reply to: SAPER59

;; will return the pulldown location (indexed 1) loaded menu pop if suceessful else 0
(defun POPNUMBER (name / mnl mnu mnc)   ;; not case sensitive (POPNUMBER "DOBLADO")
  (setq mnl nil mnu (vla-get-menubar (vlax-get-acad-object)) mnc (vla-get-count mnu) mnl nil)
  (repeat mnc (setq mnl (cons (vla-get-name (vla-item mnu (setq mnc (1- mnc)))) mnl)) )
  (vl-position name (mapcar '(lambda (e)(strcase (vl-string-subst "" "&" e))) mnl)) )

 

Message 6 of 8
Jason.Piercey
in reply to: SAPER59

You should test that code thoroughly before marking it as a solution.

Message 7 of 8
SAPER59
in reply to: SAPER59

Sorry I forgot to inform that the code works OK, and that was the reason I accepted it as solution, and it is what I was looking for: a function that check the menu voice and let me informed about if it is displayed or not

 

Thanks to all

 

Message 8 of 8
Jason.Piercey
in reply to: SAPER59

In my limited tests it appeared to not quite function as the notes mentioned,

should be case-sensitive friendly, and doesn't account for the possibility of

the same pop menu name defined in different menu groups.  My point is, it

has the potential to provide false results.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

”Boost