Jump to content

Custom Selection Tool : select rectangles of a certain size

Recommended Posts


I would like to know if someone  knows a way to select all the rectangles of a certain height in a drawing. A tool like custom selection would be perfect. Except that custom selection allows to select all the rectangles, but not to downsize the selection with an extra criteria such as height or width... 

Would you know about how this could be done? I often Pat Stanford ideas about script and wondered if there would be something like that.

thank you for your help. 

Edited by blimey

Share this post

Link to post

Take a look at the Select Similar tool in the Basic Tool Palette.

You can click on the Preferences button in the Mode Bar and choose to select objects with the same Size.

Share this post

Link to post

P.S - it would be great if this tool preference could have a tolerance setting - even seemingly identically sized objects are a floating point different to each other and therefore won't be captured

Edited by bcd
  • Like 1

Share this post

Link to post

How about this.  Tolerance in the script is set to zero so requires an exact match.  Change the value on line 16 of the script to set a tolerance for near matches.


Procedure SelectSameHeight;

{September 23, 2019}
{© 2019 Patrick Stanford pat@coviana.com}
{Licensed under the GNU Lesser General Public License}

{Using a selected rectangle as the source selects all rectangles}
{in the drawing with the same height using a user setable tolerance.}
{Tolerance is set by changing the value in the Const section of the}

{No warranty expressed or implied. Use at your own risk.}
{Test on an inconspicuous sport before using}
{Here by dragons.}

Const	Tolerance=0";

Var	H1:	Handle;
	OrigHeight, ThisHeight:real;

Procedure Execute(HD:Handle);

		If ((ThisHeight >= OrigHeight-Tolerance) AND (ThisHeight <= OrigHeight+Tolerance)) then SetSelect(HD);
	If (H1<> Nil) and (GetTypeN(H1)=3) then
		AlrtDialog('A Rectangle Must Be Selected to use this command');



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