Dim curves(0) As AutoCAD.AcadEntity Dim centerpoint(2) As Double r = 500 centerpoint(0) = 0: centerpoint(1) = 0: centerpoint(2) = 0 Set curves(0) = ModelSpace.AddCircle(centerpoint, r) Dim object As Variant object = ModelSpace.AddRegion(curves)
这段程序创建了一个用于旋转的圆的截面吧,我查了一下VBA的例子,它用一个半圆做截面旋转就没有问题,原因我不清楚。所以我改成了下面这段程序
Dim curves(1) As AutoCAD.AcadEntity Dim centerpoint(2) As Double r = 500 centerpoint(0) = 0: centerpoint(1) = 0: centerpoint(2) = 0
Set ModelSpace = ThisDrawing.ModelSpace Dim startAngle As Double Dim endAngle As Double radius = 500 startAngle = 0 endAngle = pi Set curves(0) = ThisDrawing.ModelSpace.AddArc(centerpoint, radius, startAngle, endAngle)
Set curves(1) = ModelSpace.AddLine(curves(0).StartPoint, curves(0).EndPoint)
下面就不会报错了。。。。
还有就是你的声明给的不全吧,什么Modelspace,SendCommand都没有声明。。。。。。下面删除曲线的程序你自己改吧。。。。。真是不知道为什么整圆不能使用。。。。。。
|