L = N x C + 2R


Sub flat1(L As Double, C As Double)
 'L = N x C + 2R
 'L and C are the inputs
 'Length and Centers
    
 'N and R are the outputs
 'N = Number of full spaces
 'R = length of ends - Remainder
     
 Dim N As Integer
 Dim R As Double
 Dim str As String
 Dim i As Integer
 
 If L / C < 1.25 Then
 MsgBox " L / C < 1.25 "
 Exit Sub
 End If
   
 N = Fix(L / C)
 R = (L - N * C) / 2
 
  If R < 0.25 * C Then
    N = N - 1
    R = (L - N * C) / 2
  End If
 'now N and R are derived

  If hole_slot = "SLOT" Then
    Call flat_slot(L, N, C, R)
  End If
    
  If hole_slot = "HOLE" Then
    Call flat_hole(L, N, C, R)
  End If
 
  acadApp.Update
End Sub

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.