明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1169|回复: 1

选择集应用一列

[复制链接]
发表于 2008-11-9 15:45:00 | 显示全部楼层 |阅读模式

通过选择交叉实体,返回选择集内包括文本实体。

Function CreateSelectionSetCrossingText(pt1 As Variant, pt2 As Variant) As AcadSelectionSet
   On Error Resume Next
   Dim sSet As AcadSelectionSet
   'Dim SSet As AcadSelectionSet
   If Not IsNull(ThisDrawing.SelectionSets.Item("SelectEntity")) Then
     Set sSet = ThisDrawing.SelectionSets.Item("SelectEntity")
     sSet.Delete
   End If
   Set sSet = ThisDrawing.SelectionSets.Add("SelectEntity")
   Dim gpCode(0) As Integer
   Dim dataValue(0) As Variant
   gpCode(0) = 0
   dataValue(0) = "Text"
  
   sSet.Select acSelectionSetCrossing, pt1, pt2, gpCode, dataValue

   Set CreateSelectionSetCrossingText = sSet

End Function


Sub lsls()
  Dim pt1, pt2
  Dim sSet As AcadSelectionSet
  pt1 = ThisDrawing.Utility.GetPoint(, "Input First Point")
  pt2 = ThisDrawing.Utility.GetCorner(pt1, "Input First Point")
  Set sSet = CreateSelectionSetCrossingText(pt1, pt2)
  Dim objText As AcadText
  For ii = 0 To sSet.Count - 1
    Set objText = sSet.Item(ii)
    Debug.Print objText.TextString
  Next ii
End Sub

发表于 2008-11-11 08:02:00 | 显示全部楼层
本帖最后由 作者 于 2008-11-11 8:03:10 编辑

兰州人发贴,属于精品,顶。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-26 07:48 , Processed in 0.173897 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表