- 积分
- 987
- 明经币
- 个
- 注册时间
- 2004-2-13
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
楼主 |
发表于 2004-8-4 20:20:00
|
显示全部楼层
Sub Test() Dim ssetObj As AcadSelectionSet Dim CC As AcadCircle Dim points(0 To 59) As Double Dim retCoord As Variant
On Error Resume Next Set ssetObj = ThisDrawing.SelectionSets.Add("TEST_SSET2")
On Error GoTo ErrHandle Dim pFrom, pTo Dim p1(3) As Double, p2(1) As Double Dim pPL As AcadLWPolyline pFrom = ThisDrawing.Utility.GetPoint(, vbCr & "请输入第一点:") pTo = ThisDrawing.Utility.GetPoint(pFrom, vbCr & "请输入下一点:") p1(0) = pFrom(0): p1(1) = pFrom(1) p1(2) = pTo(0): p1(3) = pTo(1) Set pPL = ThisDrawing.ModelSpace.AddLightWeightPolyline(p1) Do While True pTo = ThisDrawing.Utility.GetPoint(pTo, vbCr & "请输入下一点:") p2(0) = pTo(0): p2(1) = pTo(1) pPL.AddVertex (UBound(pPL.Coordinates) + 1) / 2, p2 Loop ErrHandle: pPL.Closed = True
'points = pPL.Coordinates retCoord = pPL.Coordinates
ssetObj.SelectByPolygon acSelectionSetCrossingPolygon, retCoord
For Each CC In ssetObj
On Error Resume Next
CC.color = acBlue CC.Update
Next CC
ssetObj.Clear ssetObj.Erase ssetObj.Delete
End Sub
为什么会在ssetObj.SelectByPolygon acSelectionSetCrossingPolygon, retCoord无法编译过去,请大侠帮我指正,谢谢! |
|