tangagen发表于2004-6-18 18:03:00一般的可以作出来,但是如果要求圆弧和直线相切的话,圆弧的凸度应该怎么计算啊? - Sub test()
- Dim p1, p2, p3 As Variant, p(5) As Double
- p1 = ThisDrawing.Utility.GetPoint(, "请输入第一点:")
- p2 = ThisDrawing.Utility.GetPoint(p1, "请输入第二点:")
- p3 = ThisDrawing.Utility.GetPoint(p2, "请输入第三点:")
- p(0) = p1(0): p(1) = p1(1)
- p(2) = p2(0): p(3) = p2(1)
- p(4) = p3(0): p(5) = p3(1)Dim ang1 As Double, ang2 As Double, ang As Double
- ang1 = ThisDrawing.Utility.AngleFromXAxis(p1, p2)
- ang2 = ThisDrawing.Utility.AngleFromXAxis(p2, p3)
- ang = 3.1415926 + ang1 - ang2Dim pl As AcadLWPolyline
- Set pl = ThisDrawing.ModelSpace.AddLightWeightPolyline(p)pl.SetBulge 1, Tan(0.5 * 3.1415926 - 0.5 * ang)
- End Sub
|