欢迎来到天天文库
浏览记录
ID:27680229
大小:77.00 KB
页数:9页
时间:2018-12-03
《cad画齿轮的渐开线程序(lsp)和渐开线齿轮关系》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、一、CAD中齿轮画法有下面一段渐开线程序:;;;begainsuprgear.lsp;SPURGEAR丄SP-alispprogrambyTonyHotchkiss;Thisroutinedrawsaspurgearusingjoined;polylines.Itletsyouuseanypressureangle;todesignthegearteeth.(defunerr(s)(if(=s"Functioncancelled")(princHSPURGEAR-cancelled:”)(progn(princ"XnSPURGEAR-Error:")(princ
2、s)(terpri)));if(resetting)(princ"SYSTEMVARIABLEShavebeenreset")(princ));err(defunsetv(systvarnewval)(setqx(read(strcatsystvar.’1”)))(setx(getvarsystvar))(setvarsystvarnewval));setv(defunsetting()(setqoerr*error*)(setq*error*err)(setv”CMDECHO”0)(setv"BLIPMODE”0));endofsetting(defunrse
3、tv(systvar)(setqx(read(strcatsystvar.’1”)))(setvarsystvar(evalx)));restv(defunresetting()(rsetv”CMDECHO.’)(rsetv"BLIPMODE”)(setq*error*oerr));endofresetting(defundxf(codeename)(cdr(assoccode(entgetename))));dxf(defunspurgear(/DNphiDOROABDRDBinv-plstp1trimcodeinventpOpcurventlinentIinen
4、t2ent2p2)(setqD(getreal”Pitchdiameter:*')N(getint"Numberofteeth:”)phi(getreal,fPressureangle:M)phi(*(/phi180)pi);PressureangleDO(*D(+(/2.0N)1.0));OutsidediameterRO(/DO2.0);OutsideradiusA(/DN);AddendumB(*1.25A);DedendumDR(-D(*B2.0));RootdiameterDB(*D(cosphi));Basecircledia.inv-pls
5、t(involuteDBNphi)involutepointstrimcodenil);setq(command"ZOOM”(list0(-B))(listRO(/RO1.5)));command(setqinvent(draw-invinv-plst));Drawinvolute.(setqpO(carinv-plst)trimcode(ext-trimpODRD);trimorextend);setq;theinvolute.(if(andtrimcode(=trimcode0))(progn;Joinstheinvolutetotheextension.(se
6、tqp(list(/DR2.0)0))(command”PEDIT”p”Y”"Jninvent"nnX”)(setqcurvent(entlast)));progn(setqcurvent(entlast)));if(if(nulltrimcode)(setqcurventinvent))(setqlinent(draw-top-lineDDBNRO));topline,(command"COPY"linent••’’’*0,0””0,0")(setqIinent2(entlast))(setqent2(mir-itcurventlinent));mirrorcur
7、ve(command"PEDIT”curvent"J”linentent2…••’X”)(segmentDRNIinent2);Finishthejob!(setqp1(list(-RO)(-RO)))(setqp2(listRORO))(command.’ZOOM..p1p2)(prompt’’ConvertingtoPOLYLINE,pleasewait."”)(command”PEDIT”(entlast)nJ””C”p1p2•…”X”)(prompt”AIIdone!”));spurgear(defuninvolute(DBNphi/numerd
此文档下载收益归作者所有