需要材料:
1.打包軟件Setup Factory 9
2.CAD插件,test.cuix(菜單文件)和test.arx文件(插件文件)
具體步驟:
1,創建自動加載菜單文件acad2012.lsp
文件內容爲:
(if (not (= (substr (ver) 1 11) "Visual LISP")) (load "acad2012doc.lsp"))
(command "menuload" "test.cuix")
(princ)
其中 test.cuix爲菜單文件。
2,創建自動加載arx的acad.rx文件
文件內容爲:
test.arx
其中test.arx爲插件。
3,Setup Factory 9新建工程。選擇這四個文件(rx,lsp,arx,cuix文件)
其中rx和arx放到安裝目錄,lsp和cuix放到安裝目錄\Support中。
4.設置安裝插件的目錄爲CAD的安裝目錄,這裏以CAD 2012爲例。
1)設置AppFolder爲CAD的安裝路徑。
(1)打開On Startup
(2)在On Startup中輸入
-- ProductPath爲註冊表中CAD的安裝目錄
path1 = 'SOFTWARE\\Autodesk\\AutoCAD\\R18.2\\ACAD-A001:804\\';
ProductPath = Registry.GetValue(HKEY_LOCAL_MACHINE, path1, 'AcadLocation', true);
if(ProductPath~="")then
-- 設置%AppFolder%的值爲ProductPath
SessionVar.Set("%AppFolder%",ProductPath);
end