呵呵,谢谢楼上两位的帮忙,还有一个问题,我想要生成圆环
步骤:1.先画两个同心圆,分别生成面域
2.运用布尔差运算,外圆减去内圆,生成圆环.程序还是有问题
程序如下:
Dim circle1(0) As AcadEntity Dim circle2(0) As AcadEntity Dim regionObj1 As Variant Dim regionObj2 As Variant Dim point(0 To 2) As Double Dim radius1 As Double Dim radius2 As Double point(0) = 300 point(1) = 300 point(2) = 300 radius1 = 80 radius2 = 60 '创建面域 Set circle1(0) = ThisDrawing.ModelSpace.AddCircle(point, radius1) Set circle2(0) = ThisDrawing.ModelSpace.AddCircle(point, radius2) regionObj1 = ThisDrawing.ModelSpace.AddRegion(circle1) regionObj2 = ThisDrawing.ModelSpace.AddRegion(circle2) '布尔运算 regionObj1.Boolean acSubtraction, regionObj2
应该是最后一句有问题,可不知道怎么改 |