基于proe的齒輪參數(shù)化設計_第1頁
基于proe的齒輪參數(shù)化設計_第2頁
基于proe的齒輪參數(shù)化設計_第3頁
基于proe的齒輪參數(shù)化設計_第4頁
基于proe的齒輪參數(shù)化設計_第5頁
已閱讀5頁,還剩18頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、基于pro/e的齒輪參數(shù)化設計一、齒輪設計實現(xiàn)文件/ chilunsheji.cpp :定義dll的初始化例程。#includc ,fstdafx.hm#include "chilunsheji.h"#include "loaddlg.h"#include "promenu.h"include nproutil.hh #includc npromcnubar.hn #include <promessage.h>bunctions declarationint geardesign 1 menuactfn();static

2、uicmdaccessstate accessavailable(uicmdaccessmode);#ifdcf debug #define new debug new #endif int geardesign 1();int geardesign2();/ cchilunshcjiappbegin_message_map(cchilunshejiapp, cwinapp)end_message_map()/ cchilunshejiapp 構造cchilunshcjiapp: :cchilunshejiapp()/ 唯一的一個 cchilunshejiapp 對彖 cchilunsheji

3、app theapp;/ cchilunshejiapp 初始化/function: user_initialize()extern ucm int user_initialize()proerror status;profilename msgfile;uicmdcmdld pushbutton_cmd_id;prostringtowstring(msgfilc,"message 1 .txt");/ 設置菜單信息文件名/status=promcnubarmcnuadd ("geardesign蔦"geardesign",”utilities

4、", pro_b_true, msgfile);procmdactionadd(hpushbuttonactmxuicmdcmdactfn) geardesign 1 menuactfn, uicmdpriodefault,accessavailable,pro_b_true,pro_b_true,&pushbutton_cmd_id);promenubarmenupushbuttonadd(mgeardesignm/geardesign 1,7,geardesign 1 "geardesign1”,null, pro_b_true, pushbutton_cmd_

5、id, msgfilc);return status;promenubarmenupushbutton add(hgeardesign,7tgeardesign2m/,geardesign2,7,geardesign2”,null, pro_b_true, pushbutton_cmd_id, msgfilc);66return status;hhfunction : user_terminate()extern ncn void user_terminate()afx_manage_state(afxgetstaticmodulestate();bool cchilunshejiapp:in

6、itinstance()cwinapp:initlnstance();return true;static uicmdaccessstate accessavailable(uicmdaccessmode access_mode) return (access_available);二、齒輪設計対話框實現(xiàn)文件#include "stdafx.h"#inckidc "chilunsheji.h"#include "loaddlg.h"include nloaddlg2.hh#include "loaddlg3.h"#

7、include hloaddlg4.hh#includc <prosolid.h>#include <math.h>include nproutil.hn#include <prowindows.h>#inckidc <proparamctc匚h>#include <proparamval.h>implement_dynamic(cloaddlg, cdialog)cloaddlg:cloaddlg(cwnd* pparcnt /*=null*/):cdialog(cloaddlg:idd, pparent)cloaddlg:cloa

8、ddlg()void cloaddlg:dodataexchange(cdataexchange* pdx)cdialog: :dodataexchange(pdx);begin_message_map(cloaddlg, cdialog)67 return status;/function: user_terminate()extern nch void user_terminate()afx_manage_state(afxgetstaticmodulestate();bool cchilunshejiapp:initinstance()cwinapp:initinstancc();ret

9、urn true;static uicmdacccssstatc acccssavailablc(uicmdacccssmodc acccss_modc) return (access_available);二、齒輪設計對話框實現(xiàn)文件#include "stdafx.h"#include "chilunsheji.h"#inckidc "loaddlg.h"#include nloaddlg2.h"include mloaddlg3.hh#include "loaddlg4.hh#include <proso

10、lid.h>#include <math.h>#include "proutil.h'*#include <prowindows.h>#include <proparameter.h>#include <proparamval.h>implement_dynamic(cloaddlg, cdialog)cloaddlg:cloaddlg(cwnd* pparent /*=null*/):cdialog(cloaddlg:idd, pparent)cloaddlg: >cloaddlg()void cloaddlg:d

11、odataexchange(cdataexchange* pdx)cdialog:dodataexchange(pdx);begin_message_map(cloaddlg, cdialog)67on_bn_clicked(idc_button1, &clonddig:onbnclickedbugnl)on_bn_clicked(idc_button2, &cloaddlg:onbnclickedbutton2)on_bn_cl1cked(idc_button3, &cloaddlg:onbnclickedbutton3)end_message_map()void c

12、loaddlg:onbnclickedbuttonl()afx_manage_stat 玖 afxgetstaticmodulestate();int status;cloaddlg2 loaddlg;status=loaddlg.domodal();void cloaddlg:onbnclickedbutton2()afx_manage_state(afxgctstaticmodulcstatc();int status;cloaddlg3 loaddlg;status=loaddlg.domodal();void cloaddlg:onbnclickedbutton3()afx_manag

13、e_state(afxgctstaticmodulcstatc();int status;cloaddlg4 loaddlg;status=loaddlg.domodal();三、直齒圓柱齒輪對話框實現(xiàn)文件/ loaddlg2.cpp :實現(xiàn)文件#include "stdafx.h"#include "chilunsheji.h"#include hloaddlg2.hh#includc <prosolid.h>#include <math.h>include nproutil.hn#include <prowindows.

14、h>#include <proparameter.h>#includc <proparamval.h>implement_dynamic(cloaddlg2, cdialog)cloaddlg2:cloaddlg2(cwnd* pparent /*二null*/):cdialog(cloaddlg2:ldd, pparent)m_z=17;m_angle=20;68m_c=0.25;m_m=1();m_ha=1;m_b=100;m_d=o;m_db=o;m_da=();m_tip_rad=o;m_df=o;cloaddlg2:>cloaddlg2()begi

15、n_message_map(cloaddlg2, cdialog)on_bn_clicked(idok, &cloaddlg2:onbnclickcdok)on_bn_cl1cked(idcancle, &cloaddlg2:onbnclickedcancle)on_bn_clicked(idc_mokuaichongsheng,& cloaddlg2:onbnclickedmokuaichongsheng)end_message_map()void cloaddlg2: :onbnclickedok()onok();promdl model;promodelitem

16、modelitem;pronamcparamnamel,paramnanie2,paramname3,paramnanie4,paramname5,paramname6;/wchar_t *paramname;proparameter param 1 ,param2,param3,param4,param5,param6;proparamvalue value 1 ,value2,value3,value4,value5,value6;proerror status;updatedata(true);status=promdlcurrentget(&m odd);if (status

17、!=pro_tk_no_error)return ;promdltomodelitem(model &modelitem);prostringtowstring(paramname 1 ,"z");prostringtowstring(paramname2/,anglem);prostringtowstring(paraniname3;,ch);prostringtowstring(paramnamc4/,mn);prostiingtowsdinypanimnamesrha”);prostringtowstring(paramname6,',b,')

18、;status=proparamctcrinit(&m odelitem,paramn ame 1,&param 1);status=proparameterlnit(&m odelitemf aamname2,&param2);status=proparameterinit(&m odelitem,panimn3me3,&param3);69status=proparameterinit(&m odelitemf aramname4,&param4);status=proparamctcrinit(&m odelitem

19、,paramname5, &param5);status=proparameterinit(&m odelitem,paramname6,&paam6); if (status=pro_tk_no_error)proparametervalueget(&paiam 1, &value 1);value 1 v aluc.d_val=m_z;proparametervalueset(&param 1, &vahie 1);/zproparametervalueget(&param2, &value2);value2.valu

20、e.d_val=m_angle;proparametervalueset(&param2, &value2);/angleproparametervalueget(&param3, &value3);value3.value.d_val=m_c;proparametervalueget(&param4, &value4);valuc4.valuc.d_val=m_m;proparametervalueset(&param4, &value4);/m獲得參數(shù)值(ha)proparamctcrvalucgct( &param5

21、,& val uc5); value5.value.d_val=m_ha;proparametervalueset(&param5, &value5);/haproparametervalueget(&param6, &value6); value6.value.d val=m b;»mm7proparametervalucsct(&param6, &valuc6);/bprosolidregenerate (prosolid)model,pro_b_true);prowindowrepaint(pro_value_unused

22、);updatedata(false);void cloaddlg2:onbnclickedcancle()oncancel();void cloaddlg2:onbnclickedmokuaichongsheng()promdl model;promodclitcm modclitcm;pronameparamnamel,paramname2,paramname3,paramname4,paramname5,paramname6; /wchar_t *paramnamc;proparameter param 15param2,param3,param4,param5,param6;propa

23、ramvalue value 1 ,value2,value3,value4,value5,value6;70proerror status;u pdatcdata(truc);status=promdlcurrentget(&m odel);if (status !=pro_tk_no_error)return ;promdltomodelitem(model, &modelitem);prostringto w string(paramn ame 1 ,"z");prostringtowstring(paramname2,"angle"

24、;);prostringtowstring(paramname3,ucn);prostringtowstring(paramn ame4, "m");prostringtowstring(paramname5,"han);prostringtowstring(paramname6,ub");status=proparameterinit(&m odelitemfaramname 1,&param 1);status=proparameterinit(&m odelitem,paniitiname5,&p“ram5);sta

25、tus=proparameterinit(&m odelitemf aramname6,&param6); 訐(status=pro_tk_no_error)proparametervalueget(&param 1, &value 1);value!. value.d_vai=m_z;proparametervalueset(&param 1, &value 1 );/zproparamctcrvalucgct(&param2, &valuc2);value2.value.d_val=m_angle;proparameterva

26、lueset(&param2, &value2);/angleproparametervalueget(&panim3, &value3); value3.value.d val=m c;proparamctcrvalucsct(&param3, &valuc3);/cproparametervalueget(&param4, &value4);value4.value.d_val=m_m;proparametervalueset(&param4, &value4);/mproparametervalueget(&

27、amp;param5, &value5);value5.value.d_vai=m_ha;proparametervalueset(&param5, &value5);/ha value6. value.d_val=m_b;m_d=m_z*m_m;/dm_db=m_d*cos(m_angle);/dbm_da=m_d+2*m_m*m_ha;/dam_tip_rad=3.1415*m_m/8;/tip_radm_df=m_d-2*m_m*(m_ha+m_c);/df71 prosolidregenerate (prosolid)model,pro_b_true);prow

28、indowrcpaint(pro_value_unused);updatedata(false);bool cloaddlg2: :oninitdialog()cdialog:oninitdialog();promdl model;promodelitem modelitem;pronameparamnamel,paramname2,paramname3,paramname4,paramnanie5,paramname6;/wchar_t *paramname;proparam value value i,valuc2,valuc3,valuc4,valuc5,vakic6;proerror

29、status;status=promdlcurrentget(&m odel);訐(status !=pro_tk_no_error)promdltomodelitem(model, &modelitem);prostringtowstring(paraninamel,"z");prostringtowstring(paramname2,"angle");prostringtow string(paramn ame3 ,"c");prostringtowstring(paramname4/fmh);prostringt

30、owstring(paramname5,"hau);prostringtowstring(paramname6,'b");status=proparameterinit(&m odelitemfaramname 1、&param 1);status=proparamctcrinit(&m odelitem,paramn ame2,&param2);status=proparameterlnit(&m odelitemf aamname3,&param3);status=proparameterinit(&m o

31、deli(em,p aramname4,&param4);status=proparameterinit(&m odelitem,paraitiname5,&p“ram5);status=proparameterinit(&m odelitemf aramname6,&param6); 訐(status=pro_tk_no_error)proparametervalueget(&paraml, &value 1);m_z=valuel .value.d_val;proparametervalueget(&panim2, &

32、value2);m angle=value2.value.d val;proparamctcrvalucsct(&param2, &valuc2);/angleproparametervalueget(&param3, &value3);m c=value3.value.d val;72proparametervalueset(&param3, &value3);/cproparamctcrvalucgct(&param4, &valuc4);m_m=value4. value.d_val;proparametervalueset

33、(&param4, &value4);/mproparametervalueget(&panim5, &value5);m ha=value5.value.d val;proparametervalueset(&param5, &valuc5);/haproparametervalueget(&param6, &value6);m_b=value6.value.d_val;proparametervalueset(&param6, &value6);/breturn true; / return true unle

34、ss you set the focus to a controlvoid cloaddlg2:dodataexchange(cdauiexchange* pdx)cdialog: dodataexchange(pdx);ddx_text(pdx, idc.editl, m_z);ddx_tcxt(pdx, idc_edit2, m_angle);ddx_text(pdx, idc_edit3, m_c);ddx_text(pdx, idc.edit4, m_m);ddx_text(pdx, idc_edit5, m_ha);ddx_text(pdx, idc_edit6, m_b);ddx_

35、tcxt(pdx, idc_edit7, m_d);ddx_text(pdx, 1dc.ed1t& m_db);ddx_text(pdx, idc_edit9, m_da);ddx_text(pdx, idc_edit10, m_tip_rad);ddx_text(pdx, idc.editl 1, m_df);四、直齒圓錐齒輪對話框實現(xiàn)文件/ loaddlg3.cpp :實現(xiàn)文件#include "stdafx.h"#include "chilunsheji.h"include uloaddlg3.hh#include <prosolid

36、.h>#include <math.h>#include "proutil.h"#inckidc <prowindows.h>#include <proparameter.h>#include <proparamval.h>implement_dynamic(cloaddlg3, cdialog)cloaddlg3:cloaddlg3(cwnd* pparent /null*/)73ddx_text(pdx, idc_edit7, m_beta);ddx_text(pdx, idc.edit& m_s);ddx_tcxt(pdx, idc_edit9, m_gamma);六、響應文件響應函數(shù)#include"stdafx.hh#inckidcmloaddlg.hm#include"chilunsheji.h"include "loaddlg.h"int geardesign

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論