4 Replies Latest reply on Mar 27, 2014 9:01 AM by Nick Baker

    Sketching Angled Lines (degrees - integer increments)

    Nick Baker

      Hello all,

       

      Would one of you please assist me in sketching lines in exact degrees (integers 0 to 180)? The output is angles that are not consistently integers. Here is the code I'm currently utilizing:

       

      Function SketchAngleLinesInUpperHalf(ByVal Diameter As Double)
          'Input Units are Inches
          Dim i As Integer
          Dim R As Double
          Dim pi As Double
          Dim Xcord As Double
          Dim Ycord As Double
          pi = Atn(1) * 4
          R = Diameter / 2
          
          For i = 0 To 180
              Xcord = R * Cos(i * pi / 180)
              Ycord = R * Sin(i * pi / 180)
              Set swSketchSegment = swSketchMgr.CreateLine(0, 0, 0, Xcord, Ycord, 0)
          Next
      End Function
      

       

       

      SS-08.png

       

      How can I get the angle of each line to be an integer?

       

      Thanks,

      Nick