autolisp stretch help!

autolisp stretch help!

Anonymous
Not applicable
1,321 Views
8 Replies
Message 1 of 9

autolisp stretch help!

Anonymous
Not applicable

Hello everyone. I have a stretch problem I hope to help you answer. I often use the Stretch command to edit the drawings. But when using it, I usually have to go through a bridge and press the calculator to add or subtract. Can I ask if there is any way to just enter new data when stretching. for example, the old rectangle is 300m long. After entering 500, the following image stretch will become 500 rectangle too, no need to go through the mental step to get 500 -300 sir. I see in the section 'cal does not allow to pick the 2-ended mouse to show the distance, so we have to re-enter the old data, then add or subtract the old number, but the calculated data is sometimes too odd. Input is long and easy to confuse guys. Hope you guys answer, as well as there is any lisp that can support this, I hope you share. I would like to thank you.

0 Likes
Accepted solutions (2)
1,322 Views
8 Replies
Replies (8)
Message 2 of 9

ВeekeeCZ
Consultant
Consultant

Post dwg example of what you're describing. Maybe add some notes to clearly understand your attempts.

Message 3 of 9

Anonymous
Not applicable

đó là tất cả những gì tôi muốn diễn giải khi dùng lệnh stretch 

0 Likes
Message 4 of 9

pbejse
Mentor
Mentor

pbejse_0-1615470669012.png

 

0 Likes
Message 5 of 9

ВeekeeCZ
Consultant
Consultant

I think that you need to have 5 msgs to be able to add attachments. So write 3 more and see.

0 Likes
Message 6 of 9

Kent1Cooper
Consultant
Consultant

As a possible starting point, there's RectangleSizeAdjust.lsp with its RSA command, >here<.  It asks for an amount to change by, but see the last line of commentary at the top of the file -- I had in mind to include an option like what you describe.  Maybe this will spur me to work on that.

Kent Cooper, AIA
0 Likes
Message 7 of 9

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

.... the old rectangle is 300m long. After entering 500, the following image stretch will become 500 rectangle too, no need to go through the mental step to get 500 -300 sir. ....


There's a built-in way to do that if you're willing to do both opposite sides of the rectangle in separate steps.  Have Dynamic Input turned on [F12 key], select the rectangle, pick on a grip at a corner you want to move, and use Tab to cycle through the possible values you can change, until the length of the side you want to change is featured [white text on blue background], and type in the new length.  Do the same on the opposite side.  Here, I change the edges that are 2-and-an-odd-fraction inches long to 4".

RectAdj.gif

It even works with non-orthogonally-oriented rectangles, without needing to establish a direction for a Stretch displacement, here with your example numbers:

RectAdj500.gif

Kent Cooper, AIA
0 Likes
Message 8 of 9

Kent1Cooper
Consultant
Consultant
Accepted solution

Here's yet another way.  This is a function to find a location at any Angle and Distance From a Reference point:

 

(defun ADFR (/ pt) ; = Angle & Distance From Reference point
  (osnap
    (polar
      (setq pt (getpoint "Reference Point: ")); point
      (getangle pt "Angle: "); angle
      (getdist "Offset Distance: "); distance
    )
    "_non"
  ); osnap
); defun

 

Load that routine definition.  Start a STRETCH command and cross-window the end of the rectangle you want to change, and pick a corner you want to move.  Then type in (ADFR) [including the parentheses], and it will ask you for a Reference point [the other end of the edge you want to change the length of], an Angle [toward your corner], and a Distance [your 500 in this example]:

RectAdj500-ADFR.gif

Kent Cooper, AIA
Message 9 of 9

Anonymous
Not applicable
Accepted solution

Thanks you very much!

0 Likes