Dexie Posted March 30, 2015 Share Posted March 30, 2015 I want to select all circles of the same size on a plan and replace with a symbol which will be the same radius. The select similar tool does not have radius as an option and custom selection menu does not have this option. If I can select all circles in one hit and replace with a scaled symbol to match the circle radius that would be even better. Any ideas? Quote Link to comment
Dexie Posted March 31, 2015 Author Share Posted March 31, 2015 Pat Stanford posted a script for selecting lines of similar length back in 2012. Can this be modified to select circles of same radius? http://techboard.vectorworks.net/ubbthreads.php?ubb=showflat&Number=166219Post166219 Procedure SelectSameLengthLines; {If the first selected object in the drawing is a line} {this script gets the length of that line and selects all} {other lines in the drawing that have the same length.} {February 13, 2012} {? 2012, Coviana, Inc - Pat Stanford pat@coviana.com} {Licensed under the GNU Lesser General Public License} Var H1 :Handle; OLength :Real; Procedure DoIt(H2:Handle); Begin If HLength(H2)=OLength then SetSelect(H2); End; Begin If GetType(FSActLayer)=2 then Begin OLength:=HLength(FSActLayer); ForEachObject(DoIt,((T=LINE))); End Else AlrtDialog('First Selected Object Must Be A Line.'); End; Run(SelectSameLengthLines); Quote Link to comment
Ozzie Posted March 31, 2015 Share Posted March 31, 2015 Select Similar Tool has Object Size Quote Link to comment
AlanW Posted March 31, 2015 Share Posted March 31, 2015 Ho,Ho,Ho, There is always something to learn. Thanks Quote Link to comment
Dexie Posted March 31, 2015 Author Share Posted March 31, 2015 You are quite right and I thought that should work. I just found to that none of the circles are exactly the same size. Object info palette said 12m. but in fact it was 12.0002m. same with all the circles. Down to the document precision settings. Thanks again for making me think. Quote Link to comment
Pat Stanford Posted March 31, 2015 Share Posted March 31, 2015 Ok, then how about a way to do this with a tolerance. Procedure SelectSimilarDiameterCircles; {If the first selected object in the drawing is a Circle} {this script gets the Diameter of that Circle and selects all} {other Circles in the drawing that have a diameter within} {the tolerance given} {March 31.2015} {© 2015 - Pat Stanford pat@coviana.com} {Licensed under the GNU Lesser General Public License} Var H1 :Handle; ODiam, MinDiam, MaxDiam :Real; Tolerance : Real; Function Diameter(H3:Handle):Real; Var X1,Y1,X2,Y2:Real; Begin GetBBox(H3,X1,Y1,X2,Y2); Diameter:=X2-X1; End; Procedure DoIt(H2:Handle); Var TDiam:Real; Begin TDiam:=Diameter(H2); If ((TDiam > MinDiam) and (TDiam < MaxDiam)) then SetSelect(H2); End; Begin If EvalStr(FSActLayer,ST)='Circle' then Begin Tolerance:=RealDialog('Enter Percentage Tolerance for Match without % sign. 5% = 5', '5') / 100; ODiam:=Diameter(FSActLayer); MinDiam:=ODiam*(1-Tolerance); MaxDiam:=ODiam*(1+Tolerance); ForEachObject(DoIt,((ST=Circle))); End Else AlrtDialog('First Selected Object Must Be A Circle.'); End; Run(SelectSimilarDiameterCircles); Quote Link to comment
AlanW Posted March 31, 2015 Share Posted March 31, 2015 LOL, Sorry I apologize if I offend but your crazy, How did you learn all this stuff, its amazing the depth of knowledge that is on tap in this forum. Love it. Alan Quote Link to comment
Pat Stanford Posted March 31, 2015 Share Posted March 31, 2015 No offense taken. Five key items. 1. Vectorscript is based on Pascal that I learned in college, so I had a head start. 2. I started learning a lot of this back when there was a lot less to learn. 3. I am a firm believer in automating as many tasks as possible. The normal rule is as long as it will take me less than 10 times longer to automate it than to do it by hand It is more fun to script it. 4. I am a big procrastinator and scripting is usually way more fun than what I am supposed to be doing. 5. Yeah, I probably am crazy ;-) I just like to be helpful. I figure the more examples we have out there, the more people who will consider scripting and the better off the entire community will be. Quote Link to comment
Dexie Posted April 2, 2015 Author Share Posted April 2, 2015 Pat That sees really useful, I will give it a try. I'd like to thank you for all your help. Cheers. 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.