半椭圆弧用VBA语言怎么画?
<p>用sendcommand命令,不知是系统响应太慢还是怎么的,画不出来,出现以下字段</p><p>命令: _ellipse<br/>指定椭圆的轴端点或 [圆弧(A)/中心点(C)]: _a<br/>指定椭圆弧的轴端点或 [中心点(C)]: -3483.56427052899,-2404.93706178788,0<br/>指定轴的另一个端点: -3443.56427052899,-2484.93706178788,0<br/>指定另一条半轴长度或 [旋转(R)]: 10<br/>需要点或选项关键字。<br/>指定另一条半轴长度或 [旋转(R)]: 0<br/>需要点或选项关键字。<br/>指定另一条半轴长度或 [旋转(R)]: 180<br/>需要点或选项关键字。</p><p>也想过先画个完整的椭圆再剪切删除一半,试了一下,不成功。</p><p>有什么更好的方法吗?</p> AddEllipse <p>AddEllipse这个是画完整的椭圆的哦,我是想直接画个半椭圆</p><p>不行的话就在完整的椭圆上进行操作,生成一个半椭圆,但现在还没实现,真伤脑筋啊。</p> 生成后可以修改StartAngle和EndAngle属性来改成椭圆弧 <pre class="Code">Autocad开发者帮助文件示例,addellipse项,</pre><pre class="Code">Sub Example_AddEllipse()<br/> ' This example creates an ellipse in model space.<br/> Const Pi As Double = 3.1415926<br/> Dim ellObj As AcadEllipse<br/> Dim majAxis(0 To 2) As Double<br/> Dim center(0 To 2) As Double<br/> Dim radRatio As Double<br/> <br/> ' Create an ellipse in model space<br/> center(0) = 0: center(1) = 0: center(2) = 0#<br/> majAxis(0) = 20: majAxis(1) = 0: majAxis(2) = 0#<br/> radRatio = 0.5<br/> Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)<br/> ZoomExtents</pre><pre class="Code">'对起始角和终点角改动后就可以得到半椭圆或四分之一椭圆.<br/> ellObj.StartAngle = 0<br/> ellObj.EndAngle = 90 * Pi / 180<br/> ellObj.Update<br/>End Sub</pre><pre class="Code"></pre> mccad 发表于 2006-12-22 09:49 static/image/common/back.gifAddEllipse
版主帮忙,如下代码,我的本意是画长轴3.75,短轴1.875的椭圆,但是画出来,长轴是280!!!
这是怎么回事?求助。%>_<%
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) = -1.25: center(1) = 280: center(2) = 0#
majAxis(0) = -5: majAxis(1) = 280: 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
页:
[1]