我不知道我是否收到了你的问题,但我想把它和所有其他问题(acad等)放在一起。
- (defun c:Crea_menu()
- ;; This example creates a new menu called TestMenu and inserts a menu item
- ;; into it. The menu is then displayed on the menu bar, and then
- ;; removed from the menu bar.
- (setq acadObj (vlax-get-acad-object))
- (setq currMenuGroup (vla-Item (vla-get-MenuGroups acadObj) 0))
-
- ;; Create the new menu
- (setq newMenu (vla-Add (vla-get-Menus currMenuGroup) "Cordoli"))
-
- ;; Add a menu item to the new menu
- ;; Assign the macro string the VB equivalent of "ESC ESC _open "
- (setq openMacro (strcat (Chr 3) (Chr 3) (Chr 95) "cordolo" (Chr 32)))
- (setq newMenuItem (vla-AddMenuItem newMenu (1+ (vla-get-Count newMenu)) "Avvia l'applicazione" openMacro))
-
- ;; Display the menu on the menu bar
- (vla-InsertInMenuBar newMenu (1+ (vla-get-Count (vla-get-MenuBar acadObj))))
- )
这似乎在acad2009中有效,但在acad2015中无效 |