1 Reply Latest reply on Jul 21, 2015 7:06 AM by Willie Roelofs

    How to use RotateAboutAxis

    Willie Roelofs

      Hi,

       

      I want to use RotateAboutAxis, but I don't know how to use it.

       

      RotateAboutAxis(Angle, Ptx, Pty, Ptz, AxisVecX, AxisVecY, AxisVecZ)

       

      Angle: Angle of rotation

      Ptx: X Coordinate

      Pty: Y Coordinate

      Ptz: Z Coordinate

       

      AxisVecX: Direction of axis of rotation

      AxisVecY : Direction of axis of rotation

      AxisVecZ: Direction of axis of rotation

       

      How do I rotate a model 10 degrees about the y axis?

       

      I have the following set-up:

       

      Koptekst 1

      Dim swApp As SldWorks.SldWorks

      Dim swModel As SldWorks.ModelDoc2

      Dim swView As IModelView

       

       

      Sub main()

          Set swApp = Application.SldWorks

          Set swModel = swApp.ActiveDoc

          Set swView = swModel.ActiveView

       

          Ptx=0

          Pty=0

          Ptz=0

       

       

          'Rotate 10 degrees about y axis

       

       

      End Sub

        • Re: How to use RotateAboutAxis
          Willie Roelofs

          Hi guys,

           

          I found it out myself:

           

          Dim swApp As SldWorks.SldWorks

          Dim swModel As SldWorks.ModelDoc2

          Dim swView As IModelView

           

          Sub main()

              Set swApp = Application.SldWorks

              Set swModel = swApp.ActiveDoc

              Set swView = swModel.ActiveView

           

              swView.RotateAboutAxis 10 / 57.3, 0, 0, 0, 0, 1, 0

           

          End Sub

           

          I tried:

          bret = swView.RotateAboutAxis (10 / 57.3, 0, 0, 0, 0, 1, 0)

           

          the whole time... Thx anyway.