【正文】
(_T(創(chuàng)建))。 return。 ProStringToWstring(p_temp_path,c_part_temp_path)。 char c_mdl_name[PRO_NAME_SIZE]=。endif //用參數(shù)驅(qū)動 UsrParamDriv(new_mdl)。: 修改模型原理:程序啟動起初獲取當前模型,通過程序界面輸入?yún)?shù)響應值,驅(qū)動尺寸.a) 初始化,在UsrRepairInit中添加CUsrParam cparam。 err=ProMdlNameGet(mdl,mdl_name)。 CStringArray csa_keys。d_d1)。m_edit_d2)。 ProMdl mdl。 CString cs_d1。 err=(mdl,m_d1_paramname,PRO_PARAM_DOUBLE,amp。 err=ProWindowCurrentGet(amp。 =PRO_PARAMETER。 //獲取參數(shù)值 ProParamvalueType param_value_type=param_type。 ProParameter param_obj。 if (err!=PRO_TK_NO_ERROR) return err。以前對C語言總是一知半解的,現(xiàn)在已經(jīng)能夠初步運用VC++。通過這次畢業(yè)設(shè)計,我了解了二維建模與三維建模的異同之處,初步掌握了Pro/ENGINEER的相關(guān)功能及各種模型的建模方法。err=ProParamvalueSet(amp。 //定義參數(shù)句柄 char c_param_name[PRO_NAME_SIZE]。proval)。 //定義參數(shù)句柄 ProParameter param_obj。 ProSolidRegenerate((ProSolid)mdl,PRO_B_FALSE)。//轉(zhuǎn)為實數(shù) double d_d2=m_edit_d2。 CUsrParam cparam。 UpdateData(FALSE)。cs_d2_param)。 double d_d1=0。 if (err!=PRO_TK_NO_ERROR) return。 if (err!=PRO_TK_NO_ERROR) return。 ProMdlDisplay(new_mdl)。new_mdl)。 err=ProDirectoryCurrentGet(cur_dir)。 wsprintfA(c_part_temp_path,%S,part_temp_path)。 UpdateData(TRUE)。選取主菜單中的【工具】→【參數(shù)】命令,彈出“參數(shù)”對話框, 缸體模型參數(shù)圖本程序需要驅(qū)動的尺寸有:d3,d1,d2,d0其中d1為大圓直徑,d2為小圓半徑,d0為高度,d3為小圓參考基準圓的半徑,與d1成一定比例關(guān)系本程序是通過參數(shù)來驅(qū)動尺寸,: 創(chuàng)建模型原理:復制模板到當前工作路徑,代碼:a) 對話框初始化,在OnInitDialog函數(shù)中添加如下代碼: UsrDlgInit()。在已創(chuàng)建的零件三維模型基礎(chǔ)上,進一步根據(jù)零件的設(shè)計要求建立以足可以完全控制三維模型形狀和大小的設(shè)計參數(shù)。在完成這四步的情況下,可以終止UI對話框,具體方法是調(diào)用ProUIDialogExit()函數(shù)。 MFC對話框MFC是VC++程序的一個重要的軟件資源,為開發(fā)Windows應用程序提供了強大的支持,使用MFC可以實現(xiàn)程序界面的可視化設(shè)計。 //關(guān)閉進程句柄 ::CloseHandle()。//類型轉(zhuǎn)換,詳見MSDN STARTUPINFO si={sizeof(si)}。 return PRO_TK_NO_ERROR。 dlgCreate(IDD_DIALOG_TEST)。//添加修改按鈕 err=ProCmdActionAdd(usr_UsrHelp_button,(uiCmdCmdActFn)UsrActionHelp,uiProeImmediate,UsrAccessDefault,PRO_B_FALSE,PRO_B_FALSE,amp。 ProStringToWstring(Msg,)。//該函數(shù)為按鈕調(diào)用的動作函數(shù)ProError UsrActionRepair()。 return (ACCESS_AVAILABLE)。E)”,在其下添加一個下級子菜單(SubMenu )“缸體”。這樣只能修改應用程序來適應這種變化,其軟件的通用性較差。將注冊文件中ALLOW_STOP設(shè)為TRUE,可以手工終止運行。 編制注冊文件及應用程序的運行 編制注冊文件在Pro/ENGINEER中運行Pro/TOOLKIT應用程序,必須先進行注冊。其含義分別如下:第一行:Pro/ENGINEER系統(tǒng)可以識別的關(guān)鍵字,該關(guān)鍵字必須與該信息文件函數(shù)中的相關(guān)字符串相同。(1)進入Visual C++,選擇“File/New...”選項,啟動 “New”對話框。然而采用面向?qū)ο蠹夹g(shù)的Pro/TOOLKIT不允許直接訪問這些結(jié)構(gòu)的內(nèi)容。 對象句柄每個Pro/TOOLKIT對象都對應于一個結(jié)構(gòu)體,定義該結(jié)構(gòu)類型的一個具體的結(jié)構(gòu)體變量稱之對象句柄。本課題通過菜單對話框向Pro/ENGINEER發(fā)送消息,采用同步DLL模式。Pro/TOOLKIT采用的是功能強大的面向?qū)ο蟮姆绞絹砭帉懙?。?)用戶界面的設(shè)計。Visual C++,是美國Microsoft Visual Studio的一部分。Pro/ENGINEER與傳統(tǒng)的CAD系統(tǒng)僅提供繪圖工具有著極大的不同,它提供了一套完整的機械產(chǎn)品解決方案,包括機械設(shè)計、板金設(shè)計、加工制造、機構(gòu)分析、有限元分析等,它使產(chǎn)品的設(shè)計效率大大提高,使產(chǎn)品在設(shè)計初期具有更多的靈活性,保證在日后根據(jù)系統(tǒng)要求進行相應的更改和計算。變量化造型技術(shù)將所需定義的尺寸“參數(shù)”進一步區(qū)分為形狀約束和尺寸約束,而不僅僅是用尺寸來約束全部幾何。(3)參數(shù)化技術(shù)正當實體造型技術(shù)在CAD系統(tǒng)中廣泛運用時,出現(xiàn)了一種比無約束自由造型更好的算法-參數(shù)化實體造型方法。CAD技術(shù)起步于50年代后期,自從計算機出現(xiàn)之后人們就不斷地將計算機技術(shù)引入機械設(shè)計、制造領(lǐng)域。而目前我國Pro/E應用日益普及,而二次開發(fā)嚴重滯后。關(guān)鍵詞:Pro/ENGINEER、Visual C++、Pro/TOOLKIT、二次開發(fā)、九孔柱塞泵缸體缸體The Realization of Nine cylinder piston pumps steep Parametric Parts Based on the Redevelopment of Pro/EAbstract:CAD technology is made more and more use in mechanical design.Design idea can be expressed more visualized and more prehensive in threedimensional fullscale mockup than in twodimensional drawing ,and based on three dimensional full—scale mock up,many other advanced CAD such as ponent assembly,interference check,finite element analysis,motion analysis and so on can be proceed.Hence,three—dimensional design is widely used in mechanical design .However,at the present the application development severely lags behind the increasing popularization of the Pro/E application in our country .So, it is very necessary to develop the Pro/E application.This paper introduces the customization tool Pro/TOOLKIT, and taking cover flange for example, This article provides an example to introduce the technique how to design UI Dialog Boxes By way of Pro/E's secondary development tool Pro/TOOLKIT as well as pile c programs to activate and pick up UI dialog boxes in Visual C++. Taking Pro/Toolkit as development tool, a friendly design interface of Cover is established. This paper investi