我生成一个圆环面域,想让它绕着Y轴旋转90度,程序如下,大家帮我改改啊
Sub Example_Rotate3D()
Dim circle1(0) As AcadEntity Dim circle2(0) As AcadEntity Dim regionObj1 As Variant Dim regionObj2 As Variant Dim point1(0 To 2) As Double Dim radius1 As Double Dim radius2 As Double Dim solidObj As Acad3DSolid Dim polyObj As Acad3DPolyline radius1 = 15 radius2 = 10 point1(0) = 0 point1(1) = -50 point1(2) = 0 '创建面域 Set circle1(0) = ThisDrawing.ModelSpace.AddCircle(point1, radius1) Set circle2(0) = ThisDrawing.ModelSpace.AddCircle(point1, radius2) regionObj1 = ThisDrawing.ModelSpace.AddRegion(circle1) regionObj2 = ThisDrawing.ModelSpace.AddRegion(circle2) '布尔运算 regionObj1(0).Boolean acSubtraction, regionObj2(0) '三维旋转 Dim point2(0 To 2) As Double Dim point3(0 To 2) As Double Dim rotateAngle As Double rotateAngle = 90 * 3.141592 / 180# point2(0) = 0 point2(1) = 0 point2(2) = 0 point3(0) = 0 point3(1) = -50 point3(2) = 0 regionObj1.Rotate3D point2, point3, rotateAngle//这句有问题,说是"要求对象" ThisDrawing.Regen True
End Sub
[glow=255,red,2]文字[/glow] |