获取与子菜单关联的弹出菜单。 支持的平台:仅窗口 言论如果弹出菜单项不是子菜单,则此属性返回错误。 例子工 务 局: Sub Example_SubMenu() ' This example finds the menu used as the sub menu for the ' "Additional Resources" menu item in the Help menu. Dim acadMenuGroup As acadMenuGroup Set acadMenuGroup = ThisDrawing.Application.MenuGroups.Item("ACAD") Dim helpMenu As AcadPopupMenu Set helpMenu = acadMenuGroup.Menus.Item("&Help") Dim menuItem As AcadPopupMenuItem Set menuItem = helpMenu.Item(4) Dim subMenu As AcadPopupMenu Set subMenu = menuItem.subMenu MsgBox "The name of the submenu is " & subMenu.TagString End Sub Visual LISP: (vl-load-com) (defun c:Example_SubMenu() ;; This example finds the menu used as the sub menu for the ;; "Additional Resources" menu item in the Help menu. (setq acadObj (vlax-get-acad-object)) (setq acadMenuGroup (vla-Item (vla-get-MenuGroups acadObj) "ACAD")) (setq helpMenu (vla-Item (vla-get-Menus acadMenuGroup) "&Help")) (setq menuItem (vla-Item helpMenu 4)) (setq subMenu (vla-get-SubMenu menuItem)) (alert (strcat "The name of the submenu is " (vla-get-TagString subMenu))) ) |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:07
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.