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

Lisp POP menu control?

6 REPLIES 6
Reply
Message 1 of 7
mid-awe
1280 Views, 6 Replies

Lisp POP menu control?

Hi all,

 

I need a way to open specific menus @ the cursor. In ealier version of AutoCAD I used the (menucmd "P0=POP501") / (menucmd "P0=*") method to load the menu and then open it, but looking over my CUI file I find the menu I need to open has no P0 Alias. Instead I only find Element ID:

 

Element ID     PM_0006

Element ID     PMU_190_DBE90

 

What must I do?

 

Thank you for any help.

6 REPLIES 6
Message 2 of 7
mid-awe
in reply to: mid-awe

I tried everything in the help file:

 

Relative Referencing of Pull-Down and Shortcut Commands

To reference a pull-down or shortcut menu item based on its customization group and element ID, use the AutoLISP menucmd function. The following syntax references a menu item based on its element ID.

(menucmd "Gcustomizationgroup.element_id=value") 

The following example uses the relative referencing syntax to disable the menu item ID_Line that is stored in the ACAD customization group. It works regardless of the menu item's location in the menu.

(menucmd "GACAD.ID_Line=~")

If you know what is contained in the main CUIx file, you can create a partial CUIx file with an additional menu item that references the main file. In this manner, partial CUIx files and specific base files can work together.

 

With that information I made: (menucmd "GCALPOOLANDSCAPE.element_id=PMU_190_23CE8") 

once entered the return is nil. How then can I invoke the menu? How do I know if my menucmd is even correct?

 

Thank you.

Message 3 of 7
mid-awe
in reply to: mid-awe

I even tried:

(menucmd "GCALPOOLANDSCAPE.ID_PMU_190_23CE8=*")

The return is the same nil, & I don't notice anything happen.
Message 4 of 7
bhull1985
in reply to: mid-awe

Try using this, will require appropriate mods you should be able to handle..

 

 (setq Menu_Path "Y:\\XXXX\\"); Path to Menu file
 (setq Menu_Name "XXXX"); pop menu to load
 (setq Group_Name "XXXX"); groupname assigned

;; Load Pop Menu

    (if (findfile (strcat Menu_Path Menu_Name ".cuix"))
     
 (progn

       (if (/= (menugroup Group_Name) nil)
       (command "_MENUUNLOAD" Group_Name)
       ); end if
       
	(if (= (menugroup Group_Name) nil)
         
 (progn
 (command "_MENULOAD" (strcat Menu_Path Menu_Name))

;; note: in next line, replace P2 with desired Position in Menu Bar
           
(menucmd (strcat "P13=+" Group_Name ".POP13"))

       	); end progn
       ); end if
     ); end progn
    ); end if

(princ)

);defun

 HTH

 (not my code, can't remember whos, taken as a snippet from a routine where ive placed it, sry)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Please use code tags and credit where credit is due. Accept as solution, if solved. Let's keep it trim people!
Message 5 of 7
mid-awe
in reply to: bhull1985

Thank you,
I'm sure I'll discover a great place to utilize this, but my menu is already loaded, I need a way to access specific sub menus that only have an element ID and no pop# reference. And I'm hoping to open the menu / sub menu @ the cursor like shortcut menus.
Message 6 of 7
bhull1985
in reply to: mid-awe

Of course! My apologies, i mistakenly thought this function would do that. When in reality that was the portion I snipped OUT of the original to put in mine....I'll try to find the source again..

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Please use code tags and credit where credit is due. Accept as solution, if solved. Let's keep it trim people!
Message 7 of 7
mid-awe
in reply to: bhull1985

No worries bhull. I'm just glad your willing to help. 🙂

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

Post to forums  

Autodesk Design & Make Report

”Boost