我有以下代码来标识块中多段线的面积(混凝土板的轮廓)和用于标识其中一个块/板中孔的多段线累积面积:
- Public Sub GetSlabAndHoleAreas(ByVal slabBlock As AcadBlock, ByRef slabArea As Double, ByRef holeArea As Double)
- Dim entity As AcadEntity
- Try
- 'Extract the slab outline area and hole areas in mm2
- slabArea = 0
- holeArea = 0
- For Each entity In slabBlock
- 'Find the largest outline i.e. the slab outline
- If entity.ObjectName = "AcDbRegion" Then
- If entity.Area > slabArea Then
- slabArea = entity.Area
- End If
- End If
- 'Find the holes
- If entity.Layer = EASICAD_LAYERS.HOLE_SYMBOL Or entity.Layer = EASICAD_LAYERS.COLUMN_CUTOUT_SYMBOL Then
- holeArea += entity.Area
- End If
- Next
- Catch ex As Exception
- MsgBox("Reusable.GetSlabAndHoleAreas : " & ex.Message, MsgBoxStyle.OkOnly, EasiCADException.EasiCADErrorTitle)
- End Try
- End Sub
我继承了逻辑,它确实有效,并将其重构为此例程,以标准化输出…这使我询问生成的数字。这些对我来说没有意义。Slabera变量报告的是板的面积减去孔洞的累积面积。
此属性的帮助https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2016/ENU/AutoCAD-ActiveX/files/GUID-2D31D8C1-9BEC-48CF-8B73-E2AD38A08D74-htm.html没有说任何关于这种行为的事情,这不是我所期望的。但软件正在运行
有人能给我解释一下为什么从主轮廓多段线的总面积中删除这些闭合多段线区域吗<向你问好,保罗
本帖以下内容被隐藏保护;需要你回复后,才能看到! 游客,如果您要查看本帖隐藏内容请 回复 |