DWG Destroyer Posted August 11, 2009 Posted August 11, 2009 Hey, Was wondering if there was a way to cut the lines drawn in AutoCAD by a set value to reduce many lines simultaneously. What I’m after is a method that essentially takes a group of varied line lengths and reduces each line by a said amount from both ends of the line i.e. I have a line 100mm long, and wish to reduce this to 80mm by taking 10mm from each side of the line. I am aware that this is easily achieved when done one at a time, but can it be done in bulk? It would avail to no end if this aspiration became a reality. Quote
ReMark Posted August 11, 2009 Posted August 11, 2009 So you want to scale the line(s) down by 20% using the midpoint as the basepoint? This scale factor however must be variable then right? Quote
StevenMc Posted August 11, 2009 Posted August 11, 2009 So you want to scale the line(s) down by 20% using the midpoint as the basepoint? This scale factor however must be variable then right? you would have to scale every individual line then would you not. as it woud be the midpoint of everyline to be the basepoint. Quote
ReMark Posted August 11, 2009 Posted August 11, 2009 Yep. Sounds like a job for a lisp routine doesn't it? Quote
nukecad Posted August 11, 2009 Posted August 11, 2009 Can you use 'lengthen > de > -10' with a fence selection line to reduce the ends of multiple lines by 10mm each time? Or is your geometry too complicated for that? Quote
Georgiou Posted August 11, 2009 Posted August 11, 2009 What version of AutoCAD are you using? the reason why i ask is the latest few versions of autocad allow multiple trim. Hence you simply offset the specific distance with a perpendicular line, type tr and then trim multiple lines at once, by drag and clicking must be 2007 and up i think though.. Quote
Georgiou Posted August 11, 2009 Posted August 11, 2009 or additionally you can use the array comand Quote
alanjt Posted August 12, 2009 Posted August 12, 2009 What version of AutoCAD are you using? the reason why i ask is the latest few versions of autocad allow multiple trim.Hence you simply offset the specific distance with a perpendicular line, type tr and then trim multiple lines at once, by drag and clicking must be 2007 and up i think though.. i don't think you are correct, i remember using fence to trim multiple objects in v14. Quote
DWG Destroyer Posted August 12, 2009 Author Posted August 12, 2009 Well, from what everyone has thrown out there so far I think that maybe utilizing the lengthen command in a macro might be the way to go? Lest there be any other comments in the making ;] Quote
ReMark Posted August 12, 2009 Posted August 12, 2009 How are you going to designate the lines that you want to scale? Quote
DWG Destroyer Posted August 12, 2009 Author Posted August 12, 2009 Good question. To be honest, I’m not going to. I don’t think its going to be possible to get it to do exactly what I want, so what I’m going to do is 'meet in the middle' by composing a macro that will cut the legwork of the lengthen command, await my input of which line to select and act upon it once selected. Then it’s just a matter of doing the same thing over for the rest of the lines. Not ideal by any standards, but it does offer some release from the trimming/ stretching etc. Of course, if there’s anyone who feels they have a better idea then please do add a post! Quote
ronjonp Posted August 12, 2009 Posted August 12, 2009 So you want to equally add or subtract a given distance from each end of the line? Quote
DWG Destroyer Posted August 12, 2009 Author Posted August 12, 2009 That’s right. But not just one, many! And they are all varied in length etc so this complicates matters. Quote
ReMark Posted August 12, 2009 Posted August 12, 2009 Well I have seen references to lisp routines that will scale blocks based upon their insertion points. Maybe one of the routines could be reworked to suit your needs. The point is that each line segment's midpoint will have to be determined. How many lines are we talking here? And is it just some lines not all lines? Are polylines included too? Quote
DWG Destroyer Posted August 12, 2009 Author Posted August 12, 2009 Ah, sorry for not being clearer. Probably going to be circa 100 lines and no, not all lines in the drawing are to be affected. Just some (not all) standard lines are to be targeted. If it helps, the reason behind this idea is to help me draw beams/ columns in structural drawings. Simply snapping from column to column/ slab to slab is not acceptable as it is common practice to stop the beam/ column line a little before it intersects with what it is spanning between. I hope this clears things up somewhat! Quote
ReMark Posted August 12, 2009 Posted August 12, 2009 Yes, I understand now. I have seen that demonstrated in structural drawings in the past. Thank you. Quote
ronjonp Posted August 12, 2009 Posted August 12, 2009 Here's a quick routine to add or subtract a given distance from the ends of lines: (defun c:younameit (/ ang e ep n num obj sp ss) (setq n -1) (if (and (setq num (getdist "\nEnter or pick difference (- to subtract): ")) (setq ss (ssget '((0 . "LINE")))) ) (while (setq e (ssname ss (setq n (1+ n)))) (setq obj (vlax-ename->vla-object e)) (setq sp (vlax-get obj 'startpoint)) (setq ep (vlax-get obj 'endpoint)) (setq ang (angle sp ep)) (vlax-put obj 'startpoint (polar sp (+ ang pi) num)) (vlax-put obj 'endpoint (polar ep ang num)) ) ) (princ) ) Quote
mdbdesign Posted August 12, 2009 Posted August 12, 2009 This code add or subtracts to both ends of line. What about one end only??? Quote
DWG Destroyer Posted August 12, 2009 Author Posted August 12, 2009 This is just the thing i was looking for. Much appreciated! Although now my curiosity/ greediness have gotten the better of me - Is it possible to include polylines & arcs in this code also? Not a problem if it isn't as I seldom use them for steelwork anyway, but the peculiarity has ensnared me. 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.