資源描述:
《cad拼圖程序lisp程序》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在工程資料-天天文庫(kù)。
1、CAD拼圖程序lisp程序(clefunc:pintu(sis2(ptlpt2inna.)(setvar〃blipmocle〃)(setvar〃cmdecho〃)(getrowandcolumn)(setqpl(getpoint輸入起始點(diǎn)〃)(setqpO,pl).(setqpaO(0to10)(setqpai(list(aspaO)一(frameworkpaO)(2000)(setqpa2(list+(pal)(2000)(frameworkpal)(setqpa3(list(pa2)一(frameworkpa2)(2000)(setqpad(list+(pa3)(pa3)fr
2、amework)(setqpO,pl).(setqvl(getvar〃osmode)(setvar〃osmode〃)/i〃〃〃〃、(.commandzoom,r丿(setqnuma2)(setqnuma3)(setq(0)"(m),列清零(setqj().(setqsi(ssgetpl(list+(pl)1190)+(connectionpl)845)(thesi.(command〃copy〃si"、”pl"(0)(getboundingbox)(coimnandzoom,r)(setqs2(ssget(5/5)(1190850)(cond((?二sd(sd二1195)1185)
3、(progn(coiiunand"move"s2"(0)paO)(setqpaO(list+(paO)(1500)frameworkpaO))))((?=sd(sd二835845)(progn(command"move"s2"(0)(setqpai(pai)list(pal)(frameworkpal)614)))))((?=sd(sd二600)590)(progn(command"move"s2〃(0)(pa2)?(setqnuma2(1+numa2)(if(二(remnuma2(2)(setq(list(pa2pa2)-(frameworkpa2)440)(setq(list
4、+(pa2pa2)614)+(frameworkpa2)440))((?二sd(sd二425))))(progn(command"move"s2"(0)pa3)(setqnuma3(1+numa3)(if(=(remnuma3(2)(setqpa3(list+(pa3)440(pa3)framework)(setqpa3(list((((pa3)440)frameworkpa3)317)))(((〈二(215)(>二(dd))(progn(coiiunand"move"s2"(0)(pa4)setqpa4(list+(pa4)(frameworkpa4))));;;(t(setq
5、fn(strcatf/a4/tuhao〃a4?dwg"))(setqsi.))(setqpl(list+(pl)1(pl)framework)(setqj(1+j).)(setqpO(list(carpO)(-(cadrpO)1500)))(setqplpO)(setqin(1+1)))(setvar"osinode"vl);;;(setvar〃osmode〃16383)(prince));;;取得圖幅幅面寬度以便判斷圖幅大小(defungetboundingbox(/sspt2inpt_listptlOptllaendatamy_xmax_xmy_x_pt_listmax_x_
6、pt_listmy_x_ptmax_x_pt)(setqpt2(list(+(carpl)1195)(+(cadrpl)850)))(setqss(ssget〃w〃plpt2'((0."line"))))(setqin0)(setqpt_listnil);;;獲取所有直線端點(diǎn)并賦值給pt_list(repeat(sslengthss)(setqa(ssnamessin))(setqendata(entgeta))(setqptlO(cdr(assoc.10endata)))(setqpt_list(consptlOpt_list))(setqptll(cdr(assoc.11en
7、data)))(setqpt_list(consptllpt_list))(setqin(1+1))獲取最小點(diǎn)和最大點(diǎn)(setqpt_list(vl-blackpt_list(function(lambda(ele2)?(carel)(care2))))))(setqmy_x(car(carpt_list)))(setqpt_list(reversept_list))(setqmax_x(car(carpt_list)))(setqmy_x_pt_listnil)(setqmax