如何将二维多段线加入选择集?
我在CAD2002下用(0, "POLYLINE)和(100, "AcDb2dPolyline")过滤,有时可以有时又不行?不知为什么? 就是啊,老是有时好有时坏真的好烦那 命令: (entget(car(entsel)))<BR>选择对象: ((-1 . <图元名: 7ef56fb0>) <FONT color=#ff0033>(0 . "LWPOLYLINE")</FONT> (330 . <图元名: <BR>7ef56cf8>) (5 . "F6") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0") <BR><FONT color=#ff0033>(100 . "AcDbPolyline")</FONT> (90 . 4) (70 . 0) (43 . 0.0) (38 . 0.0) (39 . 0.0) (10 <BR>492.606 758.312) (40 . 0.0) (41 . 0.0) (42 . 0.0) (10 870.23 477.725) (40 . <BR>0.0) (41 . 0.0) (42 . 0.0) (10 1056.62 784.92) (40 . 0.0) (41 . 0.0) (42 . 0.0) <BR>(10 1175.23 514.008) (40 . 0.0) (41 . 0.0) (42 . 0.0) (210 0.0 0.0 1.0))<BR> 版主:不是这样的呀,我用了你给的命令查看,显示的不是<FONT color=#ff0033>(0 . "LWPOLYLINE")</FONT> 而是(0, "POLYLINE)。用LIST命令显示的也是POLYLINE。用<FONT color=#ff0033>(0 . "LWPOLYLINE")</FONT> 也是有时能选中,有时又不行。 <FONT color=#ff0033>(0 . "POLYLINE")</FONT> 是三维多段线,你的图形里两种多段线都有,当然有一些选不中
用ft(0)=0:fd(0)="*<FONT color=#ff0033>POLYLINE</FONT>" 谢谢。我再试试 为什么当程序第一次运行时是对的,第二次就又不对了 看看你的代码? 下面是我的代码,第一次运行可以,第二次选择集就不对了,不知道为什么?
<BR>Sub SelDGXSet()<BR> <BR> Dim ssetObj As AcadSelectionSet<BR> Dim I As Integer<BR> <BR> On Error Resume Next<BR> If ThisDrawing.SelectionSets.Count <> 0 Then<BR> For I = 0 To ThisDrawing.SelectionSets.Count - 1<BR> Set ssetObj = ThisDrawing.SelectionSets.Item(I)<BR> ssetObj.Delete<BR> Next<BR> End If
Set ssetObj = ThisDrawing.SelectionSets.Add("sset4")
Dim gpCode(0) As Integer<BR> Dim dataValue(0) As Variant
Dim TypeArray As Variant<BR> Dim DateArray As Variant
gpCode(0) = 0<BR> dataValue(0) = "*POLYLINE"<BR> <BR> TypeArray = gpCode<BR> DataArray = dataValue<BR> <BR> ssetObj.Select acSelectionSetAll, , , TypeArray, DateArray<BR> <BR> Dim PlineObj As AcadPolyline<BR> Dim poi As Variant<BR> <BR> For I = 0 To ssetObj.Count - 1<BR> po1 = 0: poi1 = 0<BR> Set PlineObj = ssetObj.Item(I)<BR> <BR> poi = PlineObj.Elevation<BR> 'poi1 = Val(poi) + Fix(Val((TxtB.Text)))<BR> poi1 = Fix(Val(poi) - 60)<BR> PlineObj.Elevation = poi1<BR> <BR> Next I<BR>End Sub If ThisDrawing.SelectionSets.Count <> 0 Then<BR> For I = 0 To ThisDrawing.SelectionSets.Count - 1<BR> Set ssetObj = ThisDrawing.SelectionSets.Item(I)<BR> ssetObj.Delete<BR> Next<BR> End If
这里改成
ThisDrawing.SelectionSets("sset4").Delete<BR>
页:
[1]
2