[VBA]怎么样一次全选连续绘制的直线?
连续绘制的直线(非多段线),怎样才能点击其中任何一根线而全部被选中。主要目的是把电气电缆原理图的上的同一根电缆导通,并且用特殊颜色显示,各位有何建议?? <P>用下面的方法可以选择端点在已知点的直线,剩下的问题应该不难了吧</P><P>Sub tt()<BR> Dim ss As AcadSelectionSet<BR> Set ss = GetSel<BR> Dim ft(4) As Integer, fd(4)<BR> ft(0) = 0: fd(0) = "Line"<BR> ft(1) = -4: fd(1) = "<or"<BR> ft(2) = 10: fd(2) = CreatePoint(0, 0, 0)<BR> ft(3) = 11: fd(3) = CreatePoint(0, 0, 0)<BR> ft(4) = -4: fd(4) = "or>"<BR> ss.Select acSelectionSetAll, , , ft, fd<BR> MsgBox ss.Count<BR>End Sub</P>
<P>Function GetSel(Optional ByVal Name As String = "TlsTest") As AcadSelectionSet<BR>On Error Resume Next<BR> ThisDrawing.SelectionSets(Name).Delete<BR> Set GetSel = ThisDrawing.SelectionSets.Add(Name)<BR>End Function</P>
<P>Function CreatePoint(Optional ByVal X As Double = 0#, Optional ByVal Y As Double = 0#, Optional ByVal Z As Double = 0#)<BR> Dim pnt(2) As Double<BR> pnt(0) = X: pnt(1) = Y: pnt(2) = Z<BR> CreatePoint = pnt<BR>End Function<BR></P> good ,thank youvery much
页:
[1]