- ;;(gxl-ListAllMenuPops MenuGroupName) 返回菜单组所有的命令
- ;;(gxl-ListAllMenuPops "ACAD")
- (defun gxl-ListAllMenuPops (menugroupname / menus dl MenuPopList itemsMenuPop item1)
- (defun itemsMenuPop (itemMenuPop / item1)
- (vlax-for item itemMenuPop
- (if (VL-CATCH-ALL-ERROR-P
- (setq item1
- (VL-CATCH-ALL-APPLY 'vla-get-SubMenu (list item))
- )
- )
- (if (/= "" (setq label (vla-get-label item)))
- (setq dl (cons (list (strcase label) ;_ 菜单名称
- (vl-string-trim
- "\003 "
- (strcase (vla-get-Macro item))
- ) ;_ 命令名称
- )
- dl
- )
- )
- )
- (itemsMenuPop item1)
- )
- )
- )
-
- (setq menus (vla-get-Menus
- (vla-item (vla-get-menugroups (vlax-get-acad-object))
- menugroupname
- )
- )
- )
- (vlax-for MenuPop menus
- (setq dl nil)
- (vlax-for item MenuPop
- (setq aa item)
- (if (VL-CATCH-ALL-ERROR-P
- (setq item1 (VL-CATCH-ALL-APPLY 'vla-get-SubMenu (list item)))
- )
- (if (/= "" (setq label (vla-get-label item)))
- (setq dl (cons (list (strcase label) ;_ 菜单名称
- (vl-string-trim
- "\003 "
- (strcase (vla-get-Macro item))
- ) ;_ 命令名称
- )
- dl
- )
- )
- )
- (itemsMenuPop item1)
- )
- )
- (setq MenuPopList
- (cons
- (cons (vla-get-NameNoMnemonic MenuPop) (reverse dl))
- MenuPopList
- )
- )
- )
- (reverse MenuPopList)
- )
|