[LISP]直接填充自定X,Y尺寸的LSP!(画天花特方便)
<FONT id=text1 style="FONT-SIZE: 10pt" face="宋体,verdana, arial, helvetica">我这有一个能修改原有HATCH文件(grid.pat),而直接填充自定X,Y尺寸(但是好象只能输入300,600,900,1200的建筑基数)的LSP,可以作为参考,加以完善命令!</FONT><FONT style="FONT-SIZE: 10pt" face="宋体,verdana, arial, helvetica">希望有人能改改,使之修改HATCH的比例或间距的命令改为能单独修改HATCH的X,Y轴的比例或间距!<BR><BR>;BY jeep 08Jan04<BR>;TO DRAW CEILING GRID<BR>(defun c:xg (/ a -a b c)<BR>(getnewline)<BR>(setvar "cmdecho" 0)<BR>(setq snap (getvar "osmode"))<BR>(setq OLDERR *ERROR*<BR>*ERROR* MYERROR <BR>pt1 (getpoint "\nSetting up point:")<BR>distY (getstring "\nLength of grid :")<BR>distX (getstring "\nHeight of grid :")<BR>pt2 (getpoint pt1 "\nAngle of grid :")<BR>)<BR>(setq angleX (angle pt1 pt2))<BR>(setq angleY (+ angleX (/ 3.14159265358979323846264338327950288419716939937510 2)))<BR><BR>(setq angleX (* angleX 57.2957795130823208767981548141326))<BR>(setq angleY (* angleY 57.2957795130823208767981548141326))<BR><BR>(setq Line1 (strcat (rtos angleX 2 5) ",0,0,0," distX))<BR>(setq Line2 (strcat (rtos angleY 2 5) ",0,0,0," distY))<BR><BR>(setq FILENAME "GRID.PAT")<BR>(setq OPENFILE (open FILENAME "w"))<BR>(write-line "*GRID, XGrid" OPENFILE)<BR><BR>(write-line Line1 OPENFILE)<BR>(write-line Line2 OPENFILE)<BR><BR>(write-line "" OPENFILE)<BR>(close OPENFILE)<BR><BR>(princ "\nSelect Polyline to fill:")<BR>(setq select (ssget))<BR><BR>(command "snapbase" pt1)<BR>(command "-bhatch" "P" "GRID" "" "" "S" select "" "")<BR>(command "snapbase" 0,0)<BR>(setq *ERROR* OLDERR) <BR><BR>(princ)<BR>);END OF XG.LSP</FONT>
<BR> 哇~~~这个程序为什么要把 pi 值用"<FONT size=2>3.14159265358979323846264338327950288419716939937510"表示???</FONT> 这是那个填充文件GRID.PAT
*GRID, XGrid<BR>90, 0,0, 0,1000<BR>90, 100,0, 0,1000<BR>0, 0,0, 0,450, -100,900 版主帮忙改改!
页:
[1]