Jump to content

lsp help for finding the scale factor of two selected objects! example: circle


Recommended Posts

Posted

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 8)

Posted

What all object types are you wanting to query?

Posted

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.

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

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

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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

×
×
  • Create New...