Jump to content

How to reduce a group of line lengths uniformly?


Recommended Posts

Posted

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.

  • Replies 35
  • Created
  • Last Reply

Top Posters In This Topic

  • DWG Destroyer

    9

  • ReMark

    8

  • ronjonp

    5

  • Lee Mac

    3

Posted

is the stretch command able to do this?

Posted

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?

Posted
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.

Posted

Yep. Sounds like a job for a lisp routine doesn't it?

Posted

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?

Posted

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..

Posted
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.

Posted

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 ;]

Posted

How are you going to designate the lines that you want to scale?

Posted

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!

Posted

So you want to equally add or subtract a given distance from each end of the line?

Posted

That’s right. But not just one, many! And they are all varied in length etc so this complicates matters.

Posted

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?

Posted

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!

Posted

Yes, I understand now. I have seen that demonstrated in structural drawings in the past. Thank you.

Posted

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)
)

Posted

This code add or subtracts to both ends of line.

What about one end only???

Posted

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...