Lesnacklie 发表于 2006-12-22 09:33:00

半椭圆弧用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>

mccad 发表于 2006-12-22 09:49:00

AddEllipse

Lesnacklie 发表于 2006-12-22 15:17:00

<p>AddEllipse这个是画完整的椭圆的哦,我是想直接画个半椭圆</p><p>不行的话就在完整的椭圆上进行操作,生成一个半椭圆,但现在还没实现,真伤脑筋啊。</p>

mccad 发表于 2006-12-22 15:22:00

生成后可以修改StartAngle和EndAngle属性来改成椭圆弧

兰州人 发表于 2006-12-23 12:06:00

<pre class="Code">Autocad开发者帮助文件示例,addellipse项,</pre><pre class="Code">Sub Example_AddEllipse()<br/>&nbsp;&nbsp;&nbsp; ' This example creates an ellipse in model space.<br/>&nbsp;&nbsp;&nbsp; Const Pi As Double = 3.1415926<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; ' Create an ellipse in model space<br/>&nbsp;&nbsp;&nbsp; center(0) = 0: center(1) = 0: center(2) = 0#<br/>&nbsp;&nbsp;&nbsp; majAxis(0) = 20: 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; ZoomExtents</pre><pre class="Code">'对起始角和终点角改动后就可以得到半椭圆或四分之一椭圆.<br/>&nbsp;&nbsp;&nbsp; ellObj.StartAngle = 0<br/>&nbsp;&nbsp;&nbsp; ellObj.EndAngle = 90 * Pi / 180<br/>&nbsp;&nbsp;&nbsp; ellObj.Update<br/>End Sub</pre><pre class="Code"></pre>

bjjob1 发表于 2014-11-29 16:29:03

mccad 发表于 2006-12-22 09:49 static/image/common/back.gif
AddEllipse
版主帮忙,如下代码,我的本意是画长轴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]
查看完整版本: 半椭圆弧用VBA语言怎么画?