从中检索顶点列表
你好如何从多段线中检索顶点列表
使用任何vl load com函数?
我们非常欢迎您想到的所有方法!
谢谢
谢伊 这
(defun VC:GetVertexList(edfx / vertex vertexList)
(foreach vertex edfx
(if (or (= (car vertex) 10) (= (car vertex) 11))
(setq vertexList (cons (cdr vertex) vertexList))
)
)
(reverse vertexList)
)
这样使用:
(setq vertexList (VC:GetVertexList (entget (car (entsel))))) 另一个,对于LWDOLYLINE和POLYLINE:
;; Retrieve Polyline Vertices-Lee Mac
;; ent - Entity name of LWPolyline or Polyline
(defun polyverts ( ent / _lwpolyverts _polyverts )
(defun _lwpolyverts ( enx / itm )
(if (setq itm (assoc 10 enx))
(cons (cdr itm) (_lwpolyverts (cdr (member itm enx))))
)
)
(defun _polyverts ( ent / enx )
(if (= "VERTEX" (cdr (assoc 0 (setq enx (entget ent)))))
(cons (cdr (assoc 10 enx)) (_polyverts (entnext ent)))
)
)
(if (= "LWPOLYLINE" (cdr (assoc 0 (entget ent))))
(_lwpolyverts (entget ent))
(_polyverts(entnext ent))
)
)
使用多段线名称调用,例如:
(if (setq s (ssget "_+.:E:S" '((0 . "*POLYLINE"))))
(polyverts (ssname s 0))
) 为什么不使用vlisp方法,或者将其用于Mac?可以区分二维和三维pline。
我认为,如果不使用vlisp,我会强迫自己更好地学习autolisp,一旦我对autolisp感到满意,我就会用vlisp奖励自己:) 你在正确的轨道上。 谢谢Tharwat
为什么测试dxf 10或dxf 11? 他可能认为您也可以选择直线或LW多段线 谢谢tharwat
页:
[1]
2