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.
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.
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)
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..