Can you send me an example of how to use InsertArcByCenter2Points in API

Hi !

I am trying to use the function InsertArcByCenter2Points in version 2.1

    Dim a As DraftSight.CircleArc

    Dim p(0 To 2) As Double

    Dim p1() As Double
    Dim p2() As Double
    Dim pCenter() As Double

   p(0) = 3328.7
   p(1) = 665.191
   p(2) = 0.0

    p1 = MyPolarPoint(p, PI/2.0, 3.0)
    p2 = MyPolarPoint(p1, PI/2.0, 3.0)
    pCenter = MyPolarPoint(p1, PI/2.0, 1.5)

    Set a = g_dsDoc.GetModel.GetSketchManager.InsertArcByCenter2Points(pCenter, p1, p2)

Error Number: 445
Description: Object doesn't support this action

Public Function MyPolarPoint(basePt As Variant, angle As Double, distance As Double) As Double()

    Dim pt(0 To 2) As Double

    pt(0) = basePt(0) + distance * Math.Cos(angle)
    pt(1) = basePt(1) + distance * Math.Sin(angle)
    pt(2) = basePt(2)
    MyPolarPoint = pt

End Function

Thanks for any help

by André de Souza Pinto

We have premium license MAQUINAS SANMARTIN LTDA BRASIL