Break multiple polylines with each other

Break multiple polylines with each other

eng_mohamedmustafa
Enthusiast Enthusiast
5,023 Views
40 Replies
Message 1 of 41

Break multiple polylines with each other

eng_mohamedmustafa
Enthusiast
Enthusiast

Hi >>> please help me in this .... after some search on the forum i find this lisp (break lines, polylines) for entire drawing.

 

 

(defun c:bmcut (/ _pts d cutter e pts pts2 p1 p2)
  (defun _pts (ent)
    (mapcar 'cdr (vl-remove-if-not '(lambda (x)
		(member (car x) '(10 11))) ent)))                       
  (setq d (getdist "\nEnter Gap distance: "))
  (princ "\nSelect Cutter lines:")
  (setq cutter (ssget (setq fl '((-4 . "<OR")
                        (-4 . "<AND")
                        (0 . "LWPOLYLINE")
                        (90 . 2)
                        (-4 . "AND>")
                        (0 . "LINE")
                        (-4 . "OR>")
                       ))
               )
  )
  (repeat (setq i (sslength cutter))
    (setq e (ssname cutter (setq i (1- i))))
    (setq pts (_pts (entget e)))
    (if (and (setq cut-ee (ssget "_F" pts fl))
             (ssdel e cut-ee)
        )
      (repeat (setq n (sslength cut-ee))
        (Setq en (ssname cut-ee (setq n (1- n))))
        (setq pts2 (_pts (entget en)))
        (setq bpt (inters (Car pts) (cadr pts) (car pts2) (cadr pts2)))
        (setq p1 (polar bpt (angle (car pts2) (cadr pts2)) (* d 0.5)))
        (setq p2 (polar bpt (angle (cadr pts2) (car pts2)) (* d 0.5)))
        (command "_break" en "_non" p1 "_non" p2)
      )
    )
  )
)

 

 

but i want some edits please >>>

1- this lisp for only vertical and horizontal poly lines only +++ ... that means if i have polyline path with (s) shape for example the lisp ignore to select the path so i want the lisp to select any shape of polyline routing

2- if i have huge drawing with multiple polylines routing i want to select entire drawing and set my gap ... then the lisp compare between the no. of polylines of the intersecting polylines and the greater the no. of polylines will cut and break the fewer the no. of polylines that intersecting with them with my specific gap

3- (optional) i want to insert spline or brackets at breaked polylines

thanks and hope to help

0 Likes
5,024 Views
40 Replies
Replies (40)
Message 41 of 41

m_mobarak2025
Community Visitor
Community Visitor

do you lisp working the same with splines ?

0 Likes