下面是我弄的一个构建面域的试验程序,你可以用选择集来构建。 Sub q() Dim obj(0 To 1) As AcadPolyline Dim x1(0 To 14) As Double Dim x2(0 To 14) As Double Dim y1(0 To 3) As Double Dim y2(0 To 3) As Double x1(0) = 915.532 x1(1) = 459.517 x1(2) = 0 x1(3) = 948.256 x1(4) = 461.206 x1(5) = 0 x1(6) = 948.256 x1(7) = 434.545 x1(8) = 0 x1(9) = 905.75 x1(10) = 435.993 x1(11) = 0 x1(12) = 915.532 x1(13) = 459.517 x1(14) = 0 x2(0) = 948.541 x2(1) = 458.139 x2(2) = 0 x2(3) = 956.261 x2(4) = 439.321 x2(5) = 0 x2(6) = 956.261 x2(7) = 404.46 x2(8) = 0 x2(9) = 915.497 x2(10) = 429.448 x2(11) = 0 x2(12) = 948.541 x2(13) = 458.139 x2(14) = 0 Set obj(0) = ThisDrawing.ModelSpace.AddPolyline(x1) Set obj(1) = ThisDrawing.ModelSpace.AddPolyline(x2) Dim regions As Variant regions = ThisDrawing.ModelSpace.AddRegion(obj) Dim r1 As AcadRegion Dim r2 As AcadRegion Set r1 = regions(0) Set r2 = regions(1) r1.Boolean acIntersection, r2 MsgBox "mj is :" & r1.Area End Sub
|