aridzv Posted December 27, 2022 Share Posted December 27, 2022 (edited) Hi. is it possible to to break a line\polyline with blocks inserted on to it at every block insetion point? the idea is to select the line to be broken and then select the blocks to break the line by them. I've attached a sample drawing. thanks, ADZ break poly with blocks.dwg EDIT: I got the answer: I have this lisp that break a polyline with many line objects and I've added INSERT in to the selection line: ;;========================================== ;; Break a single object with many objects ;;========================================== (defun c:BreakObject (/ cmd ss1 ss2) (command "._undo" "_begin") (setq cmd (getvar "CMDECHO")) (setvar "CMDECHO" 0) ;; get objects to break (prompt "\nSelect single object to break: ") (if (and (setq ss1 (ssget "+.:E:S" '((0 . "LINE,ARC,SPLINE,LWPOLYLINE,POLYLINE,CIRCLE,ELLIPSE")))) (not (redraw (ssname ss1 0) 3)) (not (prompt "\n*** Select object(s) to break with & press enter: ***")) (setq ss2 (ssget '((0 . "LINE,ARC,SPLINE,LWPOLYLINE,POLYLINE,CIRCLE,ELLIPSE,POINT,INSERT")))) (not (redraw (ssname ss1 0) 4))) (Break_with ss1 ss2 nil) ; ss2break ss2breakwith (flag nil = not to break with self) ) (setvar "CMDECHO" cmd) (command "._undo" "_end") (princ) ) Edited December 27, 2022 by aridzv Quote Link to comment Share on other sites More sharing options...
Isaac26a Posted December 27, 2022 Share Posted December 27, 2022 I am glad you found a solution by yourself but in your code there's no (break_with function, could you please post it. Thanks Quote Link to comment Share on other sites More sharing options...
aridzv Posted December 27, 2022 Author Share Posted December 27, 2022 (edited) 2 hours ago, Isaac26a said: I am glad you found a solution by yourself but in your code there's no (break_with function, could you please post it. Thanks Hi. see the attached lsp file,credit to Charles Alan Butler (the original author). ADZ breakall.lsp Edited December 27, 2022 by aridzv Quote Link to comment Share on other sites More sharing options...
mhupp Posted December 27, 2022 Share Posted December 27, 2022 This might have a few more features 1 Quote Link to comment Share on other sites More sharing options...
j2lstaples Posted December 29, 2022 Share Posted December 29, 2022 I'm currently figuring this out myself. It's possible to do if you ssget your blocks sequentially along the polyline, otherwise the code gets messy. (foreach blk (LM:ss->list (ssget)) ;; your blocks selection (setq pt (cdr (assoc 10 (entget blk)))) (command "_BREAK" pline pt pt) (setq pline (entlast)) ) you can find LM:ss->list in Lee Mac's website: Selection set to list I haven't seen the BreakAll function yet. maybe I can use that. Thanks for sharing. Quote Link to comment Share on other sites More sharing options...
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.