AnsweredAssumed Answered

How to set CenterPoint of Sketch Arc

Question asked by Yong Ning on Dec 15, 2014
Latest reply on Dec 17, 2014 by Yong Ning

How to set Point of Sketch Arc.jpg

can get centerPoint → cArr = .GetCenterPoint

 

But don't set CenterPoint.

 

Help me.  picture x,y

  x → -103.389 change 22.5

   y →  103.317 change 22.5

Thank you very much

 

 

******************************************

Private Sub ll()

  Dim SwApp As SldWorks.SldWorks, SwModel As ModelDoc2

     Set SwApp = Application.SldWorks

     Set SwModel = SwApp.ActiveDoc

  Dim SwFeat As Feature, SwSketch As Sketch

     Set SwFeat = SwModel.FeatureByName("hSketch")

     Set SwSketch = SwFeat.GetSpecificFeature2

     Debug.Print SwFeat.Name

  Dim SwSeg As SketchSegment, SegArr, ii

     SegArr = SwSketch.GetSketchSegments

  Dim SwArc As SketchArc, cArr

     For ii = 0 To UBound(SegArr)

        Set SwSeg = SegArr(ii)

        Select Case SwSeg.GetType

           Case 1

              Set SwArc = SwSeg

                With SwArc

                   cArr = .GetCenterPoint

                   cArr(0) = 45 / 2 / 1000

                   cArr(1) = cArr(0)

                   cArr(2) = 0

                   Stop

                   Debug.Print .GetRadius

                   .GetCenterPoint = cArr

                   cArr = .GetCenterPoint2

                   Stop

                End With

        End Select

     Next ii

   

 

End Sub

Attachments

Outcomes