- 积分
- 5155
- 明经币
- 个
- 注册时间
- 2003-1-15
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2003-8-24 21:24:00
|
显示全部楼层
看看我用VBA画的吧!
Sub ddARC()
Dim m, n, l, a0, a1, fx, flx As Double
Dim pp(0 To 5) As Double
Dim p As Variant
Dim pl As AcadLWPolyline
p = ThisDrawing.Utility.GetPoint(, "请输入三角形的直角顶点:")
m = ThisDrawing.Utility.GetDistance(p, "请输入三角形的斜边长度:")
l = ThisDrawing.Utility.GetDistance(p, "请输入偏移距离:")
n = ThisDrawing.Utility.GetReal("请输入偏移线的长度:")
a0 = 0
a1 = a0
Do
a0 = a1
fx = l * Sin(a0) + n * Cos(a0) - m * Sin(2 * a0) / 2
flx = l * Cos(a0) - n * Sin(a0) - m * Cos(2 * a0)
a1 = a0 - fx / flx
Loop While Abs(a1 - a0) > 0.000000001
pp(0) = p(0): pp(1) = p(1)
pp(2) = pp(0) + m * Cos(a0): pp(3) = pp(1)
pp(4) = pp(0): pp(5) = pp(1) + m * Sin(a0)
Set pl = ThisDrawing.ModelSpace.AddLightWeightPolyline(pp)
pl.Closed = True
End Sub
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
x
|