我需要选择多条折线并在它们的顶点处断开每一条。
我使用这行代码从选择集中获取折线并将它们放入列表中:
- (setq ss (ssget '((0 . "*POLYLINE"))))
我发现这个 lisp 在这个主题的顶点处打破了一条折线:
- Break pline @ vertices LPS 2010-04-01(defun c:test (/ idx obj endparam ptlst)(vl-load-com)(setq temperr *error*) (setq *error* errortrap)(setq obj (vlax-ename->vla-object (car (setq ent (entsel "\nSelect polyline: ")))) ) (if ; test if polyline (/= (vlax-get-property obj 'ObjectName) "AcDbPolyline") (princ "\nSelected entity is not a polyline") ) (setq ptlst (list (vlax-curve-getStartPoint obj)) idx 1) (if (zerop (vlax-get obj 'Closed)) (setq endparam (vlax-curve-getParamAtPoint obj (vlax-curve-getEndPoint obj)));if open param at end point (setq endparam (cdr (assoc 90 (entget (vlax-vla-object->ename obj)))));if closed # vertices )
|