Public Function AddCircleBy2Point(ByVal StartPoint As Variant, ByVal EndPoint As Variant) As AcadCircle '参数有效性检查 Debug.Assert (VarType(StartPoint) = vbArray + vbDouble) Debug.Assert (VarType(EndPoint) = vbArray + vbDouble) '计算圆心和半径 Dim CenterPoint As Variant Dim Radius As Double CenterPoint = Math.GetMiddlePointBetween2Point(StartPoint, EndPoint) Radius = Math.GetDistanceBetween2Point(StartPoint, EndPoint) / 2 '创建圆 Set AddCircleBy2Point = ThisDrawing.ModelSpace.AddCircle(CenterPoint, Radius) End Function
centerpoint的数据类型为什麽不可以是double?? |