兰州人 发表于 2009-7-24 13:00:00

AddEllipse的椭圆长轴长度的理解.

<p>此帖的目的是,在addellipse中,如何理解不好椭圆长轴长度,画的椭圆会转个角度.</p><p>Sub Example_AddEllipse()<br/>&nbsp;&nbsp;&nbsp; ' 该示例在模型空间中创建椭圆。<br/>&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; Dim ellObj As AcadEllipse<br/>&nbsp;&nbsp;&nbsp; Dim majAxis(0 To 2) As Double<br/>&nbsp;&nbsp;&nbsp; Dim center(0 To 2) As Double<br/>&nbsp;&nbsp;&nbsp; Dim radRatio As Double<br/>&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; ' 在模型空间中创建椭圆<br/>&nbsp;&nbsp;&nbsp; center(0) = 25#: center(1) = 25#: center(2) = 0#<br/>&nbsp;&nbsp;&nbsp; majAxis(0) = 400: majAxis(1) = 0#: majAxis(2) = 0#<br/>&nbsp;&nbsp;&nbsp; radRatio = 0.5<br/>&nbsp;&nbsp;&nbsp; Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)<br/>&nbsp;&nbsp;&nbsp; ZoomAll<br/>&nbsp;&nbsp;&nbsp; <br/>End Sub<br/></p><p>&nbsp;注意事项:如果要绿线与红线平行,majAxis(1) = 0#: 必须设置为0,否则椭圆会转为一个角度.</p><p>说明,红线为-500,0到500,0的直线</p><p>在AddEllipse的帮助文件中对MajorAxis描述是</p><p class="element-desc">Variant[变体] (双精度); 仅用于输入<br/>定义椭圆长轴长度的正值。 注意理解为椭圆长轴长度</p><p>&nbsp;</p>
页: [1]
查看完整版本: AddEllipse的椭圆长轴长度的理解.