欢迎来到天天文库
浏览记录
ID:28469778
大小:55.12 KB
页数:8页
时间:2018-12-10
《边界轮廓线lsp程序》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、边界轮廓线Isp程序;;边界轮廓线(vl-load-com)(defunc:yad_outline(/viewptmaxminspl2arcss_addoscorqassnptlpt2l_ptdisentm)(defunviewpt(/abcdx)(setqb(getvar"viewsize")c(car(getvar"screensize"))d(cadr(getvar"screensize"))a(*b(/cd))x(setqx(getvar"viewctr"))x(transx12)c(list(-
2、(carx)(/a2.0))(-(cadrx)(/b2.0))0.0)d(list(+(carx)(/a2.0))(+(cadrx)(/b2.0))0.0)c(transc21)d(transd21))(listcd))(defunmaxmin(lst/xnabcd)(setqx(car1st)a(carx)b(cadrx)c(carx)d(cadrx)n1)(repeat(max(-(length1st)1)0)(setqx(nthn1st)a(mina(carx))b(minb(cadrx))c(ma
3、xc(carx))d(maxd(cadrx)))(setqn(1+n)))(list(listab)(listcd))(defunspl2arc(ent/objlennumspteptssiptlpt2pt3s)(setqobj(vlax-ename->vla-objectent)len(vlax-curve-getDistAtParamobj(vlax-curve-getEndParamobj))num(1+(fix(/lendis)))num(if(=num1)2num)spt(vlax-cur
4、ve-getStartPointobj)ept(vlax-curve-getEndPointobj))(command"_.dividenent(*2num))(setvar"cecolor"Hl")(setqss(ssget"_p"))(if(equalsptept)(setqi1)(setqi0))(setqpt3spt)(setqs(ssadd))(repeatnum(setqpt2(cdr(assoc10(entget(ssnamessi)))))(if(/=num(/(+i2)2))(setqp
5、tl(cdr(assoc10(entget(ssnamess(1+i))))))(command"_.arc"pt3pt2ptl)(ssadd(entlast)s)(setqpt3ptl)(setqi(+2i)))(command"_.erase"ssent"")(setvar"cecolor""188")s)(defunss_add(sls2/n)(setqn-1)(repeat(sslengthsi)(ssadd(ssnamesi(setqn(1+n)))s2))s2)(prompt-请选择要生成
6、边界轮廓线的所有对象(图块轮廓要闭合):")(if(setqss(ssget'((0.nline,arc,circle,polyline,spline,ellipse,insert1’))))(progncor(getvar"cecolor")qa(getvar"qaflags"))(setvar"osmode"0)(setvar"cmdecho'*0)(setqn-1)(repeat(sslengthss)(vla-getboundingbox(vlax-ename->vla-object
7、(ssnamess(setqn(1+n))))'ptl'pt2)(setql_pt(appendl_pt(list(vlax-safearray->listptl)(vlax-safearray->listpt2)))))(setql_pt(maxminl_pt)ptl(carl_pt)pt2(cadrl_pt)dis(/(distanceptlpt2)20)ptl(polarptl(anglept2ptl)dis)pt2(polarpt2(angleptlpt2)dis))(
8、setql_pt(maxmin(append(viewpt)(listptlpt2))))(command"一.zoom""_w"(carl_pt)(cadrl_pt))(setvar"cecolor""188")(command"一.boundary""一a""_o""一rn"J""一y""_b"n"entss""""(polarptl(angleptlpt2)(/dis2))nn)(if(equal(entlast)ent
此文档下载收益归作者所有