- ;; 多边形边长外侧偏移封闭 2014年2月20日
- ;; 需要e派工具箱(XCAD)的支持:http://yunpan.cn/QXQKsW9gAPmpF
- ;; http://bbs.mjtd.com/thread-109219-1-1.html
- (defun c:test1520 ()
- (xyp-CMDLA0)
- (setq dist (Udist 1 "" "偏移距离<输入或鼠标直接量取>" dist nil)
- i -1
- s0 (entlast)
- )
- (xyp-MkLaCo "TEST" 1)
- (if (setq ss (ssget '((0 . "LINE,*polyline"))))
- (progn
- (while (setq s1 (ssname ss (setq i (1+ i))))
- (setq ptn (xyp-get-Vertexs s1 0))
- (if (= (xyp-DXF 70 s1) 1)
- (setq ptn (cons (last ptn) ptn))
- )
- (if (= (length ptn) 2)
- (progn
- (xyp-Offset s1 dist t nil nil)
- (setq s2 (entlast))
- (xyp-line (vlax-curve-getStartPoint s1)(vlax-curve-getStartPoint s2))
- (xyp-line (vlax-curve-getEndPoint s1)(vlax-curve-getEndPoint s2))
- )
- (progn
- (setq ptn (xyp-Ptn2CCW ptn)
- j 0
- )
- (while (and (setq p1 (nth j ptn))
- (setq p2 (nth (setq j (1+ j)) ptn))
- )
- (xyp-LineOffset p2 p1 dist)
- (setq s2 (entlast))
- (xyp-line p1 (vlax-curve-getEndPoint s2))
- (xyp-line p2 (vlax-curve-getStartPoint s2))
- )
- )
- )
- )
- (xyp-PeditJoin (xyp-SSelEntnext s0) 0)
- )
- )
- (xyp-CMDLA1)
- )
|