tfanghui 发表于 2022-7-18 00:09:41

langjs 发表于 2012-6-14 09:12
对LWPOLYLINE和POLYLINE都有效




大神,这个代码可以给定一个高度,再连接上下每条线段的端点吗

llsheng_73 发表于 2022-7-18 19:31:54

(defun makepl(arg);;arg==>(list pts 闭合标志 全局宽度 线宽 图层 颜色 厚度 线型)pts以后可省略
      (entmakex(append(mapcar'cons'(0 100 100 43 370 8 62 39 6)(append'("LWPOLYLINE""AcDbEntity""AcDbPolyline")(cddr arg)))
                      (cons(cons 90(length(car arg)))(cons(cons 70(if(cadr arg)(cadr arg)0))(mapcar'(lambda(x)(cons 10 x))(car arg)))))))
(defun c:tt(/ e p l)
(while(and(setq l nil e(car(entsel"选择需要展开的曲线")))
      (setq n(VL-CATCH-ALL-APPLY'vlax-curve-getendparam(list e)))
      (setq p(getpoint"指定展开线起点:")))
      (cond((WCMATCH(cdr(assoc 0(entget e)))"*POLYLINE")
          (while(setq p(vlax-curve-getdistatparam e n))
              (setq l(cons(polar p 0(vlax-curve-getdistatparam e n))l)n(1- n)))
          (makepl(List l)))
           (t(makepl(list(list p(polar p 0(-(vlax-curve-getdistatparam e(vlax-curve-getendparam e))(vlax-curve-getdistatparam e(vlax-curve-getstartparam e)))))))))))

999999 发表于 2022-7-18 20:57:15

顶顶顶
页: 1 [2]
查看完整版本: 如何把一段折线(pline)展开成相同延长度的直线(pline)?