本帖最后由 skg123 于 2022-5-7 20:08 编辑
- (defun c:tt ( / )
- (entmake '((0 . "POLY-LINE")
- (100 . "AcDbEntity")
- (67 . 0)
- (8 . "0")
- (100 . "AcDbPolyline")
- (90 . 7)
- (70 . 128)
- (43 . 0.0)
- (38 . 0.0)
- (66 . 1)
- (10 1.9 10.0) (40 . 0.0) (41 . 0.0) (42 . 0.0)
- (10 0.1 0.0) (40 . 0.0) (41 . 0.0) (42 . 1.0)
- (10 3.9 0.0) (40 . 0.0) (41 . 0.0) (42 . 0.0)
- (10 2.1 10.0 0.0) (40 . 0.0) (41 . 0.0) (42 . -1.0)
- (10 5.9 10.0 0.0) (40 . 0.0) (41 . 0.0) (42 . 0.0)
- (10 4.1 0.0 0.0) (40 . 0.0) (41 . 0.0) (42 . 1.0)
- (10 7.9 0.0 0.0) (40 . 0.0) (41 . 0.0) (42 . 0.0)
- (210 0.0 0.0 1.0)
- )
- )
- (princ)
- )
- ;;By Longxin 明经通道 2006.03
- ;;生成一条pline
- ;;参数:
- ;;plist:坐标点表,如:((x1 y1 z1) (x2 y2 z2) (x2 y2 z2))或((x1 y1) (x2 y2) (x2 y2))
- ;;tudulist:各点之间的凸度表,与plist相对应,可为nil
- ;;bg:标高
- ;;clo:是否闭合,1:闭合,0:不闭合
- (defun c:test ()
- (setq a '((102.946 68.6354 3) (112.102 97.4851 3) (125.484 59.4879 3) (103.651 52.4513 3))
- b '(-1.02092 -0.485629 0 -1.31201)
- )
- (makepline a b 211 1)
- )
- (defun makepline (plist clo bg tudulist / dxf n i pt)
- (setq bg (cons 38 bg)
- i 0
- n (length plist)
- dxf nil
- )
- (if (= clo 1)
- (entmake (list '(0 . "POLYLINE") '(66 . 1) '(70 . 1) bg))
- (entmake (list '(0 . "POLYLINE") '(66 . 1) bg))
- )
- (repeat n
- (setq pt (nth i plist)
- pt (list (nth 0 pt) (nth 1 pt))
- )
- (if tudulist
- (entmake (list (cons 0 "VERTEX")
- (cons 10 pt)
- (cons 42 (nth i tudulist))
- )
- )
- (entmake (list (cons 0 "VERTEX")
- (cons 10 pt)
- )
- )
- )
- (setq i (1+ i))
- )
- (entmake '((0 . "SEQEND")))
- (princ)
- )
http://bbs.mjtd.com/forum.php?mod=viewthread&tid=44662&highlight=POLYLINE
代码来源 上面帖子的 5楼,但是我没有测试成功
(entmake '((0 . "POLYLINE")
|