VBA Autocad Compart two shapes

VBA Autocad Compart two shapes

jalal.mousa
Advocate Advocate
651 Views
3 Replies
Message 1 of 4

VBA Autocad Compart two shapes

jalal.mousa
Advocate
Advocate

is there any way to compare set of  shapes (set of shapes always equal or partial of shape 1) shape 1 to determine if you need full size pc, 1/2 size or 1/4 pc

can this be achieved by comparing Area, perimeter and length of vertics ? or is there easier way ?

0 Likes
Accepted solutions (2)
652 Views
3 Replies
Replies (3)
Message 2 of 4

Ed__Jobe
Mentor
Mentor
Accepted solution

You should be able to just use the area.

Function PartsRequired (area As Double) As Double
   ' Default are is .3 * .6 = 1.8
   Select Case (area/1.8)
      Case Is >= 0 And <= 0.25
          PartsRequired = 0.25
      Case Is >= 0.26 And <= 0.5
          PartsRequired = 0.5
      Case Is >= 0.51 And <= 1
          PartsRequired = 1
   End Select
End Function

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 3 of 4

jalal.mousa
Advocate
Advocate

Hi Ed,

thanks for help but i wish it was that easy in my case.

In my case size (length and width) of pc i am comparing to shape 1 will determine also if you can use 1/2, 1/4 or you should go to full

see attached sketch both shapes have similar area but in case 1 you can get away with 1/4 of shape 1 in case 2 you must go with 1/2

in other words i have to consider length of shape sides and Area in same time to make sure both areas and length can still allow me to use 1/4 or 1/2 or if i should go with full pc

 

0 Likes
Message 4 of 4

Ed__Jobe
Mentor
Mentor
Accepted solution

It just means that you have to add more variables to your equation to figure out each case. You determine the criteria. Such as if  one of the sides is more than half of 0.6, then use a full sheet. You just need to figure out the math.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes