How to break multiple polylines at specific length at the same time?

How to break multiple polylines at specific length at the same time?

Anonymous
Not applicable
6,098 Views
4 Replies
Message 1 of 5

How to break multiple polylines at specific length at the same time?

Anonymous
Not applicable

Hello, 

I have multiple polylines, more then 4000, and I want to break them all every 100 feet. Does anybody know of a lisp or command that would all to me to select all the polylines at once, enter 100, and then it break them all every 100 from each polyline's orgin? I can find commands that allow me to select one polyline at a time and enter 100, but I want to break all polylines at the same time.  

0 Likes
Accepted solutions (1)
6,099 Views
4 Replies
Replies (4)
Message 2 of 5

deke01
Advocate
Advocate

Lee Mac has a program, "segs.lsp" that will allow you to pick multiple objects and divide into equal segments.
If all your polylines are the same length, great.
If not, it will still take some individual selection of same length polylines and determination of how many segments to divide to give you 100' segments.
The program may give you the basis you need to devise your own program to accomplish what you desire.

0 Likes
Message 3 of 5

Kent1Cooper
Consultant
Consultant
Accepted solution

@Anonymous wrote:

.... Does anybody know of a lisp or command that would all to me to select all the polylines at once, enter 100, and then it break them all every 100 from each polyline's orgin? ....  


In very simplest terms, and minimally tested:

 

(vl-load-com)
(defun C:BPS ; = Break Polyline(s) into Segments
  (/ len bpsl plss n pl)
  (defun len () (vlax-curve-getDistAtParam pl (vlax-curve-getEndParam pl)))
  (setvar 'osmode 0)
  (setq bpsl (getdist "\nSegment length to Break Polylines into: "))
  (if (setq plss (ssget ":L" '((0 . "*POLYLINE"))))
    (repeat (setq n (sslength plss))
      (setq pl (ssname plss (setq n (1- n))))
      (while (> (len) bpsl)
        (command "_.break" pl (vlax-curve-getPointAtDist pl bpsl) "@")
        (setq pl (entlast))
      ); while
    ); repeat
  ); if
  (princ)
); defun

No error handling yet, no saving the Osnap setting for reset, no <all that other stuff>, but it seems to work.

 

Kent Cooper, AIA
Message 4 of 5

naylin.oo
Contributor
Contributor

So useful command thank a lot bro.

0 Likes
Message 5 of 5

vladimir_michl
Advisor
Advisor

Or MMeasure (multiple-measure) - see:

https://www.cadforum.cz/en/qaID.asp?tip=3644

 

DivBreak.gif

 

Vladimir Michl, www.arkance-systems.cz  -  www.cadforum.cz

 

0 Likes