明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 216|回复: 6

求教 怎么画部分椭圆

[复制链接]
发表于 3 天前 | 显示全部楼层 |阅读模式
只会画整个椭圆还不会打断,怎么样通过中心和长短轴,起始点,终点或者起始角,画椭圆弧。
回复

使用道具 举报

发表于 3 天前 | 显示全部楼层
逆时针选择两点,就打断了。
回复 支持 反对

使用道具 举报

 楼主| 发表于 3 天前 | 显示全部楼层
自贡黄明儒 发表于 2025-5-30 15:53
逆时针选择两点,就打断了。

新手,不会打断啊,VBA代码怎么写?
回复 支持 反对

使用道具 举报

发表于 前天 18:55 | 显示全部楼层
水个贴,升级用

点评

emk
不要到处水贴,有意义吗?  发表于 昨天 16:26
回复 支持 反对

使用道具 举报

发表于 5 小时前 | 显示全部楼层
RetVal = object.AddEllipse(Center, MajorAxis, RadiusRatio)
创建的是椭圆,椭圆弧得设置起始角和终点角.

你参考官方例子
  1. Sub Example_AddEllipse()
  2.     ' This example creates an ellipse in model space.
  3.    
  4.     Dim ellObj As AcadEllipse
  5.     Dim majAxis(0 To 2) As Double
  6.     Dim center(0 To 2) As Double
  7.     Dim radRatio As Double
  8.    
  9.     ' Create an ellipse in model space
  10.     center(0) = 5#: center(1) = 5#: center(2) = 0#
  11.     majAxis(0) = 10: majAxis(1) = 20#: majAxis(2) = 0#
  12.     radRatio = 0.3
  13.     Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)
  14.     ZoomAll
  15.    
  16. End Sub

起始角参考
  1. Sub Example_EndAngle()
  2.     ' This example creates an ellipse and enters the start and
  3.     ' end angles to create an elliptical arc.
  4.     Dim ellObj As AcadEllipse
  5.     Dim majAxis(0 To 2) As Double
  6.     Dim center(0 To 2) As Double
  7.     Dim radRatio As Double
  8.    
  9.     ' Create an ellipse in model space
  10.     center(0) = 5#: center(1) = 5#: center(2) = 0#
  11.     majAxis(0) = 10: majAxis(1) = 20#: majAxis(2) = 0#
  12.     radRatio = 0.3
  13.     Set ellObj = ThisDrawing.ModelSpace.AddEllipse(center, majAxis, radRatio)
  14.    
  15.     'Enter a start angle of 45 degrees, and an end angle of 270 degrees
  16.     ellObj.startAngle = 45 * (3.14 / 180)
  17.     ellObj.endAngle = 270 * (3.14 / 180)
  18.     ZoomAll
  19.     MsgBox "This ellipse has a start angle of " & ellObj.startAngle * (180 / 3.14) & " and the end angle of " & ellObj.endAngle * (180 / 3.14) & " degrees.", vbInformation, "EndAngle Example"
  20. End Sub
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2025-6-2 20:42 , Processed in 0.181822 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表