LISP Routine for breaking polylines where I click.
Afternoon,
I've been trying to look for or create a LISP Routine that'll go and break a polyline at either a specific point on a polyline that isn't closed, or to go and select two points on a closed polyline to go and leaving me the original polyline and a new polyline that was cut out of the original. I need it to be able to go and be able let me click at endpoints, mid-points or anywhere along the polyline where I need it to be. I've been using the code provided below as a reference. The issue I have with it, is that when the polyline is closed, it wants to go and break the polyline at the point I clicked it at and make that new polyline go back to the first vertex. If y'all have the solution, I would appreciate the help.
(defun c:breakpoint (/ object points) ;Breaks object at points;
(setq object (entsel)) ;Set the first variable;
(princ "Specify Break Point: ") ;Set the request that you want on screen;
(setq point (getpoint)) ;Set the second variable;
(command "_break" object "f" point point)) ;insert the command that you are working with;