你的编程思想都有点问题!就有那些对象围成的闭合边界。我现有函数可以实现点击闭合区域内一点返回封闭多线段,然后进行填充!
'自定义过程,通过在若干首尾相接的实体形成的封闭区内一点能创建该区域的边界多线段用于剖面填充边界 Public Function closedZoneAddPolyline(closedZonePt() As Double) As AcadLWPolyline '获得当前的实体数量 Dim n As Long n = docObj.ModelSpace.Count '创建多线段 docObj.SendCommand "-Boundary" & vbCr & closedZonePt(0) & "," & closedZonePt(1) & vbCr & vbCr Dim objPoly As AcadLWPolyline If docObj.ModelSpace.Count > n Then Set objPoly = docObj.ModelSpace.Item(docObj.ModelSpace.Count - 1) Else MsgBox "未发现有效的边界!" End If Set closedZoneAddPolyline = objPoly End Function |