(defun C:edit_del_line_in_lwpolyline ( / LINE LINE_ODJ LIST-COOR P PARAM-SEL VLA-LINE)
  (geo_tools-help "edit_del_line_in_lwpolyline")
  (load_global_variable)
  (vla-StartUndoMark active_document)
  (setq line_odj (entsel "\nВыбери линию: "))
  (while line_odj
    (setq p (cadr line_odj))
    (setq line (car line_odj))
    (setq vla-line (vlax-ename->vla-object line))
    (if (not(eq line_odj nil))
      (if (eq (cdr (assoc 0 (entget line))) "LWPOLYLINE")
	(progn
	  (setq param-sel(vlax-curve-getParamAtPoint vla-line(vlax-curve-getClosestPointTo vla-line p)))
	  (setq list-coor(convert-safearray-to-list-points(vlax-variant-value(vla-get-Coordinates vla-line))2))
	  (if (eq (length list-coor)2)
	    (vla-erase vla-line)
	    (cond
	      ((and(vlax-curve-isClosed vla-line)(> param-sel (1-(length list-coor))))
	       (vla-put-Closed vla-line 0))
	      ((and(not(vlax-curve-isClosed vla-line))(eq (fix param-sel)0))
	       (vla-put-Coordinates vla-line (convert-list-points-to-lwpolyline-safearray (cdr list-coor)))
	       )
	      ((and(not(vlax-curve-isClosed vla-line))(or(eq (fix param-sel)(-(length list-coor)2))(eq (fix param-sel)(1-(length list-coor)))))
	       (vla-put-Coordinates vla-line (convert-list-points-to-lwpolyline-safearray (edit-list-del-item-by-number (-(length list-coor)1) list-coor)))
	       )
	      ((vlax-curve-isClosed vla-line)
	       (edit-break-Closed-LWPolyline param-sel vla-line list-coor)
	       )
	      (T
	       (edit-break-not-Closed-LWPolyline param-sel vla-line list-coor)
	       )
	      )
	    )
	  )
	)
      )
    (setq line_odj (entsel "\nВыбери линию: "))
    )
  (vla-EndUndoMark active_document)
  (princ)
  )

(defun edit-break-Closed-LWPolyline (param-sel vla-line list-coor / N RESULT-LIST)
  (setq n (1+(fix param-sel)))
  (repeat (length list-coor)
    (setq result-list(append result-list (list (nth n list-coor))))
    (setq n (if (> (1+ n) (1-(length list-coor))) 0 (1+ n)))
    )
  (vla-put-Closed vla-line 0)
  (vla-put-Coordinates vla-line (convert-list-points-to-lwpolyline-safearray result-list))
  (princ)
  )

(defun edit-break-not-Closed-LWPolyline (param-sel vla-line list-coor / N RESULT-LIST1 RESULT-LIST2)
  (setq n 0)
  (repeat (length list-coor)
    (if (or(>(fix param-sel)n)(=(fix param-sel)n))
      (setq result-list2(append result-list2 (list (nth n list-coor))))
      (setq result-list1(append result-list1 (list (nth n list-coor))))
      )
    (setq n (1+ n))
    )
  (vla-put-Coordinates vla-line (convert-list-points-to-lwpolyline-safearray result-list1))
  (draw-lwpolyline-vla-by-list-property
			     (list(cons "spece" (if (eq (getvar "CTAB")"Model")model_spece paper_spece))
				  (cons "Coordinates" result-list2)
				  (cons "Lineweight"(vla-get-Lineweight vla-line))
				  (cons "Layer"(vla-get-Layer vla-line))
				  (cons "Elevation"(vla-get-Elevation vla-line))
				  (cons "Color"(vla-get-Color vla-line))
				  (cons "Linetype" (vla-get-Linetype vla-line))
				  ))
  (princ)
  );(getvar "CTAB")