wsjwsjwsj 发表于 2013-11-2 23:27:07

三维多段线对应顶点连线问题!!!!!

(defun GetLWPolyLineVTX ( / ee j ptslist ve vtx vtxlst)
(vl-load-com)
   (setq ee (car (entsel)))
(command "ucs" "w" )
   
(setqve (vlax-ename->vla-object ee))
(setq vtx (vla-get-Coordinates ve ))
(setq vtxLst (vlax-safearray->list (vlax-variant-value vtx)))
   (setq j 0)
   (setq PtsList nil)
   (repeat (/ (length vtxLst) 3)
(setq PtsList (append PtsList (list (list (nth j vtxLst) (nth (1+ j) vtxLst) (nth (+ 2 j) vtxLst)))))
   (setq j (+ j 3)
   );end_repeat
(setq PtsList PtsList);end_defun      
   )
   )
(defun c:3plx ( / l1 l2 pt1 pt2);;;三维多段线对应顶点连线
(command "ucs" "w" )
(setq l1 (GetLWPolyLineVTX))
(setq l2 (GetLWPolyLineVTX))

(repeat (length l1)
(setq pt1 (car l1)
pt2 (car l2)
)
(command "line"pt1 pt2 "" )
(setq l1 (cdr l1)
l2 (cdr l2))
    )
)



能将连接的直线改成三维线就好了,求高手!!!!

vlisp2012 发表于 2013-11-3 07:58:21

(defun GetLWPolyLineVTX ( / ee j ptslist ve vtx vtxlst)
(vl-load-com)
   (setq ee (car (entsel)))
(command "ucs" "w" )
   
(setqve (vlax-ename->vla-object ee))
(setq vtx (vla-get-Coordinates ve ))
(setq vtxLst (vlax-safearray->list (vlax-variant-value vtx)))

   (setq j 0)
   (setq PtsList nil)
   (repeat (/ (length vtxLst) 3)
(setq PtsList (append PtsList (list (list (nth j vtxLst) (nth (1+ j) vtxLst) (nth (+ 2 j) vtxLst)))))

   (setq j (+ j 3)
   );end_repeat
(setq PtsList PtsList);end_defun      
   )
   )

(defun c:3plx ( / l1 l2 pt1 pt2);;;三维多段线对应顶点连线
(command "ucs" "w" )
(setq l1 (GetLWPolyLineVTX))
(setq l2 (GetLWPolyLineVTX))

(repeat (length l1)
(setq pt1 (car l1)
        pt2 (car l2)
        )
(command "3DPOLY"pt1 pt2 "" )
(setq l1 (cdr l1)
        l2 (cdr l2))
    )

)

wsjwsjwsj 发表于 2013-11-4 22:18:43

vlisp2012 发表于 2013-11-3 07:58 static/image/common/back.gif
(defun GetLWPolyLineVTX ( / ee j ptslist ve vtx vtxlst)
(vl-load-com)
   (setq ee (car (entsel) ...

能不能让位置对应连线,而不是点对点?高手

vlisp2012 发表于 2013-11-5 08:10:52

没明白,咋个位置对应?

tanle2020 发表于 2013-11-7 22:43:04

vlisp2012 发表于 2013-11-5 08:10 static/image/common/back.gif
没明白,咋个位置对应?

二维多段线连接时线跑很远,求高手修改。

wsjwsjwsj 发表于 2013-11-8 21:50:17

tanle2020 发表于 2013-11-7 22:43 static/image/common/back.gif
二维多段线连接时线跑很远,求高手修改。

可能是你的线方向不一致,修改线方向

水仙的错 发表于 2019-9-7 21:20:01

二维多段线对应顶点连线谁有吗???

999999 发表于 2020-8-21 00:43:34

谢谢楼主分享

yoyoho 发表于 2020-8-21 12:40:50

谢谢楼主分享程序!!!!
页: [1]
查看完整版本: 三维多段线对应顶点连线问题!!!!!