jamesfui Posted December 17, 2011 Posted December 17, 2011 hi.. need help on creating lsp that can: > find the scale factors on two selected objects & insert to dwg as dtext! example; ``````` select the two objects with different sizes; circle_1: diameter = 1500 circle_2: diameter = 1200 calculated scale factor for [circle_1/circle_2] = [1500/1200] = 1.25 if circle_2 is selected first, it will then be [circle_2/circle_1] = [1200/1500] = 0.8 ask for insertion point to insert the calculated scale factor as dtext on drawing! or just display on the command window or prompt it... thanks Quote
alanjt Posted December 17, 2011 Posted December 17, 2011 What all object types are you wanting to query? Quote
Lee Mac Posted December 17, 2011 Posted December 17, 2011 Since its only a ratio you are looking for, quickest way might be to use the ratio of the length of the diagonal of the bounding box for each object, this would allow any two objects to be compared - of course, the result would only be meaningful if the two objects were proportional. Quote
alanjt Posted December 17, 2011 Posted December 17, 2011 Since its only a ratio you are looking for, quickest way might be to use the ratio of the length of the diagonal of the bounding box for each object, this would allow any two objects to be compared - of course, the result would only be meaningful if the two objects were proportional. Good idea (iff proportional). If using the bounding box, you should be able to take the length b/w the min and max points of each object and calc the scale ratio. Quote
Lee Mac Posted December 17, 2011 Posted December 17, 2011 If using the bounding box, you should be able to take the length b/w the min and max points of each object and calc the scale ratio. Exactly - the diagonal. Quote
alanjt Posted December 17, 2011 Posted December 17, 2011 Exactly - the diagonal. Oops, I completely missed where you said diagonal and interpreted it as you wanted to take the ratio of the width and height. Quote
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.