您可以通过减去、合并或查找区域或 3D 实体的交点来创建复合区域。 然后,可以拉伸或旋转复合区域以创建复杂的实体。若要创建复合区域,请使用以下方法。Boolean 当您从一个区域中减去另一个区域时,您可以从第一个区域调用该方法。这是要从中减去的区域。例如,若要计算楼层平面图需要多少地毯,请从楼层空间的外部边界调用该方法,并将未铺设地毯的区域(如柱子和柜台)用作布尔参数列表中的对象。BooleanBoolean 对区域执行的操作由 Boolean 方法的 BooleanType 参数确定。BooleanType 参数可以是下列参数之一:
创建复合区域Sub Ch4_CreateCompositeRegions() ' Create two circles, one representing a room, ' the other a pillar in the center of the room Dim RoomObjects(0 To 1) As AcadCircle Dim center(0 To 2) As Double Dim radius As Double center(0) = 4 center(1) = 4 center(2) = 0 radius = 2# Set RoomObjects(0) = ThisDrawing.ModelSpace.AddCircle(center, radius) radius = 1# Set RoomObjects(1) = ThisDrawing.ModelSpace.AddCircle(center, radius) ' Create a region from the two circles Dim regions As Variant regions = ThisDrawing.ModelSpace.AddRegion(RoomObjects) ' Copy the regions into the region variables for ease of use Dim RoundRoomObj As AcadRegion Dim PillarObj As AcadRegion If regions(0).Area > regions(1).Area Then ' The first region is the room Set RoundRoomObj = regions(0) Set PillarObj = regions(1) Else ' The first region is the pillar Set PillarObj = regions(0) Set RoundRoomObj = regions(1) End If ' Subtract the pillar space from the floor space to ' get a region that represents the total carpet area. RoundRoomObj.Boolean acSubtraction, PillarObj ' Use the Area property to determine the total carpet area MsgBox "The carpet area is: " & RoundRoomObj.Area End Sub 查找具有属性的结果区域的区域。Area 父主题: |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:35
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.