- 积分
- 2271
- 明经币
- 个
- 注册时间
- 2004-1-10
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
楼主 |
发表于 2004-9-21 11:43:00
|
显示全部楼层
下面是我的代码,第一次运行可以,第二次选择集就不对了,不知道为什么?
Sub SelDGXSet() Dim ssetObj As AcadSelectionSet Dim I As Integer On Error Resume Next If ThisDrawing.SelectionSets.Count <> 0 Then For I = 0 To ThisDrawing.SelectionSets.Count - 1 Set ssetObj = ThisDrawing.SelectionSets.Item(I) ssetObj.Delete Next End If
Set ssetObj = ThisDrawing.SelectionSets.Add("sset4")
Dim gpCode(0) As Integer Dim dataValue(0) As Variant
Dim TypeArray As Variant Dim DateArray As Variant
gpCode(0) = 0 dataValue(0) = "*POLYLINE" TypeArray = gpCode DataArray = dataValue ssetObj.Select acSelectionSetAll, , , TypeArray, DateArray Dim PlineObj As AcadPolyline Dim poi As Variant For I = 0 To ssetObj.Count - 1 po1 = 0: poi1 = 0 Set PlineObj = ssetObj.Item(I) poi = PlineObj.Elevation 'poi1 = Val(poi) + Fix(Val((TxtB.Text))) poi1 = Fix(Val(poi) - 60) PlineObj.Elevation = poi1 Next I End Sub |
|