松松鼠 发表于 2006-5-4 11:55:10

[求助]:用程序加载菜单

我想知道,怎样用程序的方法实现菜单的卸载与加载?

AyungerStudio 发表于 2006-5-5 22:54:31

;;; No.1 加载菜单   
;;;******************
(defun C:AY(/ Menufilename)
        (if (null (menugroup "ayunger"));autoCAD中未加载给菜单组.
                (progn
                        (setq Menufilename (findfile "ayunger.mnu"));Search from autocad setup folder.
                        (if (null Menufilename)
                                (setq Menufilename (getfiled "打开AYUNGER菜单文件" "Ayunger.mnu" "mnu" 4))
                        );end_if
                        (if (null Menufilename) (exit));open dialog is ""Cancle" press.
                        (command "_menuload" Menufilename)
                        (menucmd "P16=+Ayunger.POP1")
                );end_progn
        );end_if
);end_defun

;;; No.2 卸载菜单   
;;;*******************
(defun C:UnAY()
        (if (= "AYUNGER" (strcase (menugroup "ayunger"))) (command "menuunload" "Ayunger"))
);end_defun

菜单文件Ayunger.mnu:
***MENUGROUP=AYUNGER
***POP1

[->绘图类(&R)]
[单线或双线箭头 (Arw)]^C^CArw
.......
[<-锥坡线方法二 (Zpx1)]^C^CZpx1

敬供参考!!!!!!!!!

sjl_fyl 发表于 2024-9-4 14:42:52

{:1_1:}谢谢
页: [1]
查看完整版本: [求助]:用程序加载菜单