选择集应用一列
<p>通过选择交叉实体,返回选择集内包括文本实体。</p><p>Function CreateSelectionSetCrossingText(pt1 As Variant, pt2 As Variant) As AcadSelectionSet<br/> On Error Resume Next<br/> Dim sSet As AcadSelectionSet<br/> 'Dim SSet As AcadSelectionSet<br/> If Not IsNull(ThisDrawing.SelectionSets.Item("SelectEntity")) Then<br/> Set sSet = ThisDrawing.SelectionSets.Item("SelectEntity")<br/> sSet.Delete<br/> End If<br/> Set sSet = ThisDrawing.SelectionSets.Add("SelectEntity")<br/> Dim gpCode(0) As Integer<br/> Dim dataValue(0) As Variant<br/> gpCode(0) = 0<br/> dataValue(0) = "Text"<br/> <br/> sSet.Select acSelectionSetCrossing, pt1, pt2, gpCode, dataValue</p><p> Set CreateSelectionSetCrossingText = sSet</p><p>End Function</p><p><br/>Sub lsls()<br/> Dim pt1, pt2<br/> Dim sSet As AcadSelectionSet<br/> pt1 = ThisDrawing.Utility.GetPoint(, "Input First Point")<br/> pt2 = ThisDrawing.Utility.GetCorner(pt1, "Input First Point")<br/> Set sSet = CreateSelectionSetCrossingText(pt1, pt2)<br/> Dim objText As AcadText<br/> For ii = 0 To sSet.Count - 1<br/> Set objText = sSet.Item(ii)<br/> Debug.Print objText.TextString<br/> Next ii<br/>End Sub</p><p></p> 本帖最后由 作者 于 2008-11-11 8:03:10 编辑 <br /><br /> <strong><font face="Verdana" color="#da2549">兰州人发贴,属于精品,顶。</font></strong>
页:
[1]