Autocad开发者帮助文件示例,addellipse项, Sub Example_AddEllipse() ' This example creates an ellipse in model space. Const Pi As Double = 3.1415926 Dim ellObj As AcadEllipse Dim majAxis(0 To 2) As Double Dim center(0 To 2) As Double Dim radRatio As Double ' Create an ellipse in model space center(0) = 0: center(1) = 0: center(2) = 0# majAxis(0) = 20: majAxis(1) = 0: majAxis(2) = 0# radRatio = 0.5 Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio) ZoomExtents '对起始角和终点角改动后就可以得到半椭圆或四分之一椭圆. ellObj.StartAngle = 0 ellObj.EndAngle = 90 * Pi / 180 ellObj.Update End Sub |