乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 15|回复: 0

Select选择集应用一例

[复制链接]

120

主题

326

帖子

7

银币

中流砥柱

Rank: 25

铜币
806
发表于 2008-6-11 15:27:00 | 显示全部楼层 |阅读模式
采用功能函数实现选择集中对象的增加。
  1. Function CreatSelectionSet(InputEntityObjectName As Variant) As AcadSelectionSet
  2.   On Error Resume Next
  3.   'Dim SSet As AcadSelectionSet
  4.   If Not IsNull(ThisDrawing.SelectionSets.Item("SelectEntity")) Then
  5.     Set CreatSelectionSet = ThisDrawing.SelectionSets.Item("SelectEntity")
  6.     CreatSelectionSet.Delete
  7.   End If
  8.   Set CreatSelectionSet = ThisDrawing.SelectionSets.Add("SelectEntity")
  9.   Pt1 = ThisDrawing.Utility.GetPoint(, "Input First Point")
  10.   Pt2 = ThisDrawing.Utility.GetPoint(Pt1, "Input First Point")
  11.   Dim gpCode(0) As Integer
  12.   Dim dataValue(0) As Variant
  13.   gpCode(0) = 0
  14.   For ii = 0 To UBound(InputEntityObjectName)
  15.     dataValue(ii) = InputEntityObjectName(ii)
  16.   Next ii
  17.   CreatSelectionSet.Select acSelectionSetWindow, Pt1, Pt2, gpCode, dataValue
  18. End Function
  19. Sub ReadTable()
  20.   Dim SSet As AcadSelectionSet
  21.   Dim InputEntityObjectName As Variant
  22.   InputEntityObjectName = Array("Text")
  23.   Set SSet = CreatSelectionSet(InputEntityObjectName)
  24.   Dim Ent As AcadEntity
  25.   For Each Ent In SSet
  26.     Debug.Print Ent.ObjectName
  27.   Next Ent
  28. End Sub
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-7-4 12:06 , Processed in 0.701916 second(s), 54 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表