ibanez_222 Posted July 26, 2011 Share Posted July 26, 2011 I attached this lsp. that I found off a site, and it works great. It is basically two commands in one kind of, which is ABB or ABBE. I don't know what the letters stand for but the ABB pretty much copies a selected block and you can insert it anywhere you want and it automatically breaks the lines around the block. The ABBE lets you select a block and it will break the lines around it and the command stays in play so you can keep going around the drawing to clean up the blocks. This works great but I was wondering if this could be modified to work with a selection window, and cleans all blocks within the selection set? This would make thinks a lot faster. Thanks. ABB.LSP Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted July 26, 2011 Share Posted July 26, 2011 Glad you like my program A full description of the program and the latest version can be found on my site here. To break all in a selection set, add this on a new line at the end of the program file: (defun c:abbss ( / ss i ) (if (setq ss (ssget "_:L" '((0 . "INSERT")))) (repeat (setq i (sslength ss)) (LM:AutoBlockBreak (ssname ss (setq i (1- i))))) ) (princ) ) PS: ABB = AutoBlockBreak, ABBE = AutoBlockBreak Existing Quote Link to comment Share on other sites More sharing options...
alanjt Posted July 27, 2011 Share Posted July 27, 2011 You could save a lot of effort if you put wipeouts in your blocks. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted July 27, 2011 Share Posted July 27, 2011 With a draw order *bring to front* Quote Link to comment Share on other sites More sharing options...
ibanez_222 Posted July 27, 2011 Author Share Posted July 27, 2011 Yea we thought about doing that but unless we can lock the draw order we would rather not. You would constantly have to check the draw order because in my experiences it never stays where you want it to. Thanks Lee Mac that works great! Quote Link to comment Share on other sites More sharing options...
alanjt Posted July 27, 2011 Share Posted July 27, 2011 Odd, I've never had that issue. Quote Link to comment Share on other sites More sharing options...
DNK Posted July 27, 2011 Share Posted July 27, 2011 Yea we thought about doing that but unless we can lock the draw order we would rather not. You would constantly have to check the draw order because in my experiences it never stays where you want it to. Thanks Lee Mac that works great! My experience is the same. Quote Link to comment Share on other sites More sharing options...
irneb Posted July 27, 2011 Share Posted July 27, 2011 I've found the draworder gets screwed every single time you use RefEdit anywhere near that drawing. Other times is when you use Tool Palette / Design Center to insert that block from out of another drawing, but then it's only this one time (though only sometimes). That's why I made a lisp for moving all wipeouts to bottom inside of blocks. The attached has 2 commands: LayerstoTop (you'll need to modify the list to suit your needs) and BlockWipeouts2Bottom DwgOrder.LSP Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted July 27, 2011 Share Posted July 27, 2011 Another, to automatically modify the draw order of all wipeouts in all blocks: http://www.cadtutor.net/forum/showthread.php?60244-Wipeout-Inside-Blocks-Issue&p=409043&viewfull=1#post409043 Quote Link to comment Share on other sites More sharing options...
madmonocle Posted October 11, 2012 Share Posted October 11, 2012 This is a really useful script, but is there any way to make it automatically run when you insert the block in the first place? For example, I use a lisp script to insert certain blocks: (defun c:valve (/ pt) (while (setq pt (getpoint "\nPick Insertion point.")) ; Choose insertion point (command "-insert" "k:/valve" "_non" pt "" "" pause) ; Insert block ) (princ) ) Right now I type in "valve" and place the block on an existing line. Next, I type ABBE and click on the valve, which trims the lines. Is it possible to automatically trim the lines between the block as soon as I place it? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted October 11, 2012 Share Posted October 11, 2012 (edited) This is a really useful script, but is there any way to make it automatically run when you insert the block in the first place? Assuming that you are referring to my Automatic Block Break program and not the other program posted in this thread, you can call the LM:AutoBlockBreak subfunction contained in my program from your code, for example: (defun c:valve ( / el ) (setq el (entlast)) (while (vl-cmdf "_.-insert" "k:/valve" "_S" 1.0 "_R" 0.0 "\\") (if (not (eq el (setq el (entlast)))) (LM:AutoBlockBreak el t) ) ) (princ) ) Of course, you will need to ensure that my program is loaded in the drawing session before calling the function. Demo: PS: Please edit your post and enclose your code with code tags: [highlight][noparse] [/noparse][/highlight] Your code here [highlight][noparse] [/noparse][/highlight] Edited October 11, 2012 by Lee Mac Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted October 20, 2012 Share Posted October 20, 2012 ...is there any way to make it automatically run when you insert the block in the first place? Did the above solution work for you, madmonocle? Or did I waste the time & effort I spent responding to your question? Quote Link to comment Share on other sites More sharing options...
madmonocle Posted October 21, 2012 Share Posted October 21, 2012 It worked brilliantly, thanks for the help! Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted October 21, 2012 Share Posted October 21, 2012 It worked brilliantly, thanks for the help! I'm glad to hear that. 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.