blimey Posted September 23, 2019 Share Posted September 23, 2019 (edited) Hello, 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 September 23, 2019 by blimey Quote Link to comment
bcd Posted September 23, 2019 Share Posted September 23, 2019 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. Quote Link to comment
bcd Posted September 23, 2019 Share Posted September 23, 2019 (edited) 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 September 23, 2019 by bcd 1 Quote Link to comment
blimey Posted September 23, 2019 Author Share Posted September 23, 2019 Whaouh ! that's what I needed. Thank you! Quote Link to comment
Pat Stanford Posted September 23, 2019 Share Posted September 23, 2019 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} {script.} {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); Begin ThisHeight:=HHeight(HD); If ((ThisHeight >= OrigHeight-Tolerance) AND (ThisHeight <= OrigHeight+Tolerance)) then SetSelect(HD); End; Begin H1:=FSActLayer; DSelectAll; If (H1<> Nil) and (GetTypeN(H1)=3) then Begin OrigHeight:=HHeight(H1); ForEachObject(Execute,((T=RECT))); End Else AlrtDialog('A Rectangle Must Be Selected to use this command'); End; Run(SelectSameHeight); Quote Link to comment
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.