Jump to content
josue Corona

rectangle stretch in increments

Recommended Posts

Hello is there script I can make that I can stretch a rectangle in increments ? it can be 2D rectangle. As for the size of the rectangle I could just type it in the object info palette? 

The increments would be a one way stretch.

Thank you 

Share this post

Link to post

Can we know what your end result might be? Why are you needing this? It gives a direction to work in.


Do you want the original to grow, or do you want a duplicate each time it grows?

Share this post

Link to post

Hello WhoCanDo and Larry,

and yes (whocando) basically that's what I am trying to accomplish, that the object to duplicate itself, next to each other as I stretch the rectangle but it will stretch in its own increments. The size of the starting rectangle can be determine in the object info. 

Larry Can the grid spacing be determine if I try that alternative for now?

Share this post

Link to post

I'm still not understanding your intention, but I'm guessing the following. Draw a rectangle and leave it selected. Run the macro and the elastic band will determine X and the location of the new rectangle.


procedure Stretch_and_Move;

pt1, pt2 : vector;
wth, ht : real;

if (Count (Sel = True) = 1) then
  pt1.x := LeftBoundN (Sel = True);
  pt1.y := TopBoundN (Sel = True);
  wth := Width (Sel = True);
  ht := Height (Sel = True);
  GetPtL (pt1.x, pt1.y, pt2.x, pt2.y);
  RectangleN (pt2.x, pt2.y, 1, 0, pt2.x - pt1.x, -Abs (ht));
run (Stretch_and_Move);


Edited by WhoCanDo
Revised RectangleN values

Share this post

Link to post

The grid spacing is easy to determine or set by double clicking the snap to grid icon. This will the bring up the smart cursor options allowing you to read the current spacing and change the grid spacing.

Share this post

Link to post

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.

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.


7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114


© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

  • Create New...