tc405003 发表于 2005-11-24 00:46:00

如何用ENTMAKE建LWPOLYLINE

如何用ENTMAKE建LWPOLYLINE

BDYCAD 发表于 2005-11-24 08:18:00

<P>PLINE&nbsp; 和 SPLINE 的生成我都習慣用</P>
<P>(SETQ controlpoint-list1 '((532.719 421.591 0.0) (717.37 471.407 0.0) (855.858 473.252 0.0) (1001.73 469.561 0.0) (1177.15 452.956 0.0) (1258.4 384.69 0.0) (1262.09 325.649 0.0) (1064.51 222.327 0.0) (894.635 183.581 0.0) (584.421 194.651 0.0) (512.407 220.482 0.0) (436.7 227.862 0.0) (353.607 227.862 0.0)))</P>
<P>(mapcar 'VL-CMDF (cons "pline" controlpoint-list1)) (VL-CMDF ""&nbsp; ""); 生成PLINE</P>
<P>(mapcar 'VL-CMDF (cons "Spline" controlpoint-list1)) (VL-CMDF ""&nbsp;"" "");生成SPLINE</P>

Student 发表于 2005-11-24 09:54:00

;<BR>;make轻多义线<BR>;EX.<BR>;(make-pl (list(list 1 2)(list 3 2)(list 8 1)) "轻多义线")<BR>(defun make_pl(ptab lay / wtab)<BR>&nbsp; (Command "_.layer" "m" lay "")<BR>&nbsp; (setq wtab(mapcar '(lambda ($pt) (cons 10 $pt)) ptab))<BR>&nbsp; (setq wtab(append(list '(0 . "LWPOLYLINE")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '(100 . "AcDbEntity")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '(100 . "AcDbPolyline")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (cons 8 lay)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (cons 90 (length ptab)))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; wtab)<BR>&nbsp; )<BR>&nbsp; (entmake wtab)<BR>)<BR>;<BR>

vken7az2p 发表于 2006-10-13 20:56:00

<P>那请问如果说要產生 pline 且某些段带有 凸度 就是弧度的话</P>
<P>该怎样生成呢?</P>

LONGXIN 发表于 2006-10-14 20:49:00

<P>;;By Longxin 明经通道 2006.03</P>
<P>;;生成一条pline<BR>;;参数:<BR>;;plist:坐标点表,如:((x1 y1 z1) (x2 y2 z2) (x2 y2 z2))或((x1 y1) (x2 y2) (x2 y2))<BR>;;tudulist:各点之间的凸度表,与plist相对应,可为nil<BR>;;bg:标高<BR>;;clo:是否闭合,1:闭合,0:不闭合<BR>;;(defun c:test ()<BR>;;(setq&nbsp;a '((102.946 68.6354 3) (112.102 97.4851 3) (125.484 59.4879 3) (103.651 52.4513 3))<BR>;;&nbsp;b '(-1.02092 -0.485629 0 -1.31201)<BR>;;)<BR>;;(makepline a b 211 1)<BR>;;)</P>
<P>(defun xl:makepline (plist clo bg tudulist / dxf n i pt)<BR>&nbsp; (setq&nbsp;bg&nbsp; (cons 38 bg)<BR>&nbsp;i&nbsp;&nbsp; 0<BR>&nbsp;n&nbsp;&nbsp; (length plist)<BR>&nbsp;dxf nil<BR>&nbsp; )</P>
<P>&nbsp; (if (= clo 1)<BR>&nbsp;&nbsp;&nbsp; (entmake (list '(0 . "POLYLINE") '(66 . 1) '(70 . 1) bg))<BR>&nbsp;&nbsp;&nbsp; (entmake (list '(0 . "POLYLINE") '(66 . 1) bg))<BR>&nbsp; )<BR>&nbsp; (repeat n<BR>&nbsp;&nbsp;&nbsp; (setq pt (nth i plist)<BR>&nbsp;&nbsp; pt (list (nth 0 pt) (nth 1 pt))<BR>&nbsp;&nbsp;&nbsp; )<BR>&nbsp;&nbsp;&nbsp; (if&nbsp;tudulist<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (entmake (list (cons 0 "VERTEX")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (cons 10 pt)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (cons 42 (nth i tudulist))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (entmake (list (cons 0 "VERTEX")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (cons 10 pt)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<BR>&nbsp;&nbsp;&nbsp; )<BR>&nbsp;&nbsp;&nbsp; (setq i (1+ i))<BR>&nbsp; )<BR>&nbsp; (entmake '((0 . "SEQEND")))<BR>&nbsp; (princ)<BR>)</P>

vken7az2p 发表于 2006-10-15 10:05:00

谢谢您的解答
页: [1]
查看完整版本: 如何用ENTMAKE建LWPOLYLINE