Community
Civil 3D Forum
Welcome to Autodesk’s Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LISP Routine for breaking polylines where I click.

6 REPLIES 6
Reply
Message 1 of 7
marcus_bogner
557 Views, 6 Replies

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;

Labels (1)
6 REPLIES 6
Message 2 of 7
pendean
in reply to: marcus_bogner


@marcus_bogner wrote:

....If y'all have the solution, I would appreciate the help.

 

(defun c:breakpoint...


Unless you are running a very old year-version of C3D, there is a command for that:

https://help.autodesk.com/view/ACD/2021/ENU/?guid=GUID-E0439DE0-B2C3-4233-BB4D-5A574A00694B

pendean_0-1719945111778.png

 

https://help.autodesk.com/view/ACD/2025/ENU/?guid=GUID-E0439DE0-B2C3-4233-BB4D-5A574A00694B 

pendean_1-1719945134480.png

 

Message 3 of 7
marcus_bogner
in reply to: pendean

I use 2019 civil 3d.

Message 4 of 7
NateSarles
in reply to: marcus_bogner

I do not have 2019 so I cannot confirm that the options listed here work. But there seems to be a possible solution in the forum post here: 

https://forums.autodesk.com/t5/autocad-forum/quot-break-at-point-quot-command-shortcut/m-p/8085887#M... 

C3D 2022
Experienced Civil Site Designer/Drafter
Windows 11, 64 GB RAM
13th Gen Intel(R) Core(TM) i7-13850HX
Message 5 of 7
pendean
in reply to: marcus_bogner


@marcus_bogner wrote:

I use 2019 civil 3d.


Have you had a chance to test what is available yet? From this post for example

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/special-polyline-break-only-at-the-p...

 

or just something like

(defun C:BreakAtPoint()
    (command "._break" "f" "@")
);end
Message 6 of 7
lim.wendy
in reply to: pendean

Hi Marcus,

Welcome to the forum!

Here are a few suggestions from our experts that might help:

Forum Solutions: As @NateSarles mentioned, a possible solution is discussed here.

Custom LISP: If you prefer sticking to a custom LISP routine, you might want to try the following snippet shared by @pendean:

 

(defun C:BreakAtPoint()
    (command "._break" "f" "@")
);end

 

 

This might help achieve the break at the exact point you click without reverting to the first vertex.

Feel free to try these suggestions and let us know how it goes.

 



Wendy Lim

Data Nerd | Community Advocate | AEC Industry


facebook twitter twitter blogs pm


Join the new online Rail Community


Rails Summit




Message 7 of 7
tcorey
in reply to: marcus_bogner

That's how Break command works. Break, select the item and where you select also becomes the first break point. If you are trying to break the item in two at that point, simply type @ when asked for second point. Also, _Breakatpoint is now a native AutoCAD command. This has you select an item to break and then asks for a break point. No gap is created.



Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Gold Reseller

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report