xenru Posted 19 hours ago Posted 19 hours ago I have multiple blocks(10 to 20) placed on multiple polylines in my map. I need to break the polylines of a huge map at the insertion point and join the vertices at the insertion point of the block. Is there any LISP available to break the polylines exactly at the insertion point ? I saw LEE MAC's LISP does something similar, but it trims the polylines at the border of the blocks. Shown in the picture (LEE MAC written) Quote
Tsuky Posted 3 hours ago Posted 3 hours ago (edited) Try this !? You can use POINT or Insert Point of block... Break_Poly@point.lsp Edited 3 hours ago by Tsuky 1 Quote
Saxlle Posted 1 hour ago Posted 1 hour ago (edited) Something like this!? ; ***************************************************************************************************** ; Functions : PLBRJ ; Description : Breaking POLYLINE at blocks insertation points and joined into the one POLYLINE ; Author : Saxlle ; Date : January 19, 2026 ; ***************************************************************************************************** (prompt "\nTo run a LISP type: PLBRJ") (princ) (defun c:PLBRJ ( / ent joinList ptlist ss len spt ept i breakPoint) (setq ent (car (entsel "\nSelect the POLYLINE:")) joinList (list) ptlist (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget ent))) ss (ssget "_F" ptlist (list (cons 0 "INSERT"))) len (sslength ss) spt (vlax-curve-getStartPoint (vlax-ename->vla-object ent)) ept (vlax-curve-getEndPoint (vlax-ename->vla-object ent)) joinList (append (list spt) joinList) i 0 ) (while (< i len) (setq breakPoint (cdr (assoc 10 (entget (ssname ss i))))) (command "_.BREAK" breakPoint "_f" breakPoint breakPoint) (setq joinList (append (list breakPoint) joinList)) (setq i (1+ i)) ) (setq joinList (reverse (append (list ept) joinList)) ss (ssget "_F" joinList (list (cons 0 "LWPOLYLINE"))) ) (command-s "_PEDIT" "m" ss "" "j" "" "") (prompt "\nThe POLYLINE was broken at blocks insert points and joined into the one POLYLINE!") (princ) ) Edited 1 hour ago by Saxlle Something strange is happening. Don't use it. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.