- 积分
- 2003
- 明经币
- 个
- 注册时间
- 2003-4-30
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2003-6-10 22:51:00
|
显示全部楼层
这是我前天才写好的,你看看有没有帮助咯
Dim retent As Object
Dim pnt As Variant
acaddoc.Utility.GetEntity retent, ont, "选择一个闭合多边形"
While Err
Err.Clearacaddoc.Utility.GetEntity retent, ont, "选择一个闭合多边形"
Wend
If retent.ObjectName = "AcDbPolyline" Then
Set tpolyline = retent
Dim k As Integer, i As Integer
k = UBound(tpolyline.Coordinates)
k1 = (k + 1) * 1.5
ReDim pointarrays(0 To k1 - 1)
For i = 0 To k1 / 3 - 1 Step 1 '把坐标赋值给数组
pointarrays(i * 3) = tpolyline.Coordinates(i * 2)
pointarrays(i * 3 + 1) = tpolyline.Coordinates(i * 2 + 1)
pointarrays(i * 3 + 2) = 0
Next
sel1.SelectByPolygon(acSelectionSetWindowPolygon, pointarrays, FILTERTYPE, FILTERDATA) |
|